namespace PMSmanage
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
{
public partial class FrmLog : DevComponents.DotNetBar.Office2007Form
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
public FrmLog()
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
InitializeComponent();
}
![](/Images/OutliningIndicators/InBlock.gif)
private void Form1_Load(object sender, EventArgs e)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
GetTree();
}
private void GetTree()
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
DataSet ds = new DataSet();
DataSet dschild = new DataSet();
string parent = TBaseOper.WebServer.GetGroupParent();
string err = null;
TBaseOper.WebServer.GetGroup_info(ref ds, ref err);
treeView1.BeginUpdate();
treeView1.Nodes.Add(parent);
treeView1.Nodes[0].Tag = "组";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
string userGroup = "", child2="";
treeView1.Nodes[0].Nodes.Add(ds.Tables[0].Rows[i][0].ToString());
treeView1.Nodes[0].Nodes[i].Tag = "组";
userGroup = ds.Tables[0].Rows[i][1].ToString();
TBaseOper.WebServer.GetUserName_bygroupId(userGroup, ref dschild, ref err);
for (int j = 0;j < dschild.Tables[0].Rows.Count; j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
child2 = dschild.Tables[0].Rows[j][0].ToString();
treeView1.Nodes[0].Nodes[i].Nodes.Add(child2);
treeView1.Nodes[0].Nodes[i].Nodes[j].Tag = dschild.Tables[0].Rows[j][1].ToString();
}
dschild.Clear();
![](/Images/OutliningIndicators/InBlock.gif)
}
treeView1.EndUpdate();
}
![](/Images/OutliningIndicators/InBlock.gif)
private void buttonX1_Click(object sender, EventArgs e)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
this.Close();
}
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
string errMsg = null;
DataSet ds = new DataSet();
ds.Clear();
if (e.Node.Tag.ToString() != "组")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
string userID = e.Node.Tag.ToString();
![](/Images/OutliningIndicators/InBlock.gif)
string BeginTime = dtp_Btime.Text;
string EndTime = dtp_Etime.Text;
if (!TBaseOper.WebServer.GetLoginRecord(BeginTime, EndTime, userID, ref ds, ref errMsg))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show(errMsg);
return;
}
//dgv_LoginLog.Rows.Clear();
if(ds.Tables[0].Rows.Count ==0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("没有该用户的登陆记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
dgv_LoginLog.DataSource = ds.Tables[0];
}
}
![](/Images/OutliningIndicators/InBlock.gif)
private void dgv_LoginLog_CellClick(object sender, DataGridViewCellEventArgs e)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
DataSet ds=new DataSet ();
string err="";
if (dgv_LoginLog.RowCount ==1)
return;
string loginID = dgv_LoginLog[6, dgv_LoginLog.CurrentRow.Index].Value.ToString();
if (loginID == "")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("请选择登陆记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (!TBaseOper.WebServer.GetOperRecord (loginID ,ref ds,ref err))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show(err);
}
if (ds.Tables[0].Rows.Count == 0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("没有该用户的操作记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
dgv_UserLog.DataSource = ds.Tables[0];
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/InBlock.gif)
private void btn_search_Click(object sender, EventArgs e)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
string memo = txt_memo.Text;
if (memo == "")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("请输入查询描述!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
DataSet ds = new DataSet();
string err = "";
if (dgv_LoginLog.RowCount == 1)
return;
string loginID = dgv_LoginLog[0, dgv_LoginLog.CurrentRow.Index].Value.ToString();
if (loginID == "")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("请选择登陆记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (!TBaseOper.WebServer.GetOperRecordByOper (loginID ,memo ,ref ds,ref err))
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show(err);
}
if (ds.Tables[0].Rows.Count == 0)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
MessageBoxEx.Show("没有该用户的操作记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
dgv_UserLog.DataSource = ds.Tables[0];
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/None.gif)
posted @
2007-12-28 11:31
tiasys
阅读(
232)
评论()
编辑
收藏
举报