Ejemplo n.º 1
0
        public override void DeleteCmd()
        {
            DataTable       reasonTable = OMWorkBench.DataAgent.GetStateChangeReason(currentAgentId, 0);
            FrozedAgentForm frozedAgent = new FrozedAgentForm(reasonTable);

            frozedAgent.Text = "删除";
            if (frozedAgent.ShowDialog() == DialogResult.OK)
            {
                DataAgent dataAgent = DataAgentFactory.GetDataAgent();
                dataAgent.ChangeAgentSatate(OMWorkBench.AgentId, Convert.ToInt32(AgentDGV.CurrentRow.Cells["id"].Value), frozedAgent.FrozedResonStr, 2);
                _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 2;
                agentBDS.Filter    += " and current_state<2";
                AgentDGV.DataSource = agentBDS;
            }
            base.DeleteCmd();
        }
Ejemplo n.º 2
0
        private void YESBtn_Click(object sender, EventArgs e)
        {
            DataAgent dataAgent = DataAgentFactory.GetDataAgent();
            DataTable dt        = dataAgent.GetExistUser(userIdTextBox.Text);

            if (dt.Rows.Count > 0)
            {
                int A = dataAgent.AddExistUser(OMWorkBench.AgentId, OMWorkBench.MangerId, userIdTextBox.Text);
                this.DialogResult = DialogResult.Yes;
            }
            else
            {
                userExistLabel.Text      = "此用户不存在!";
                userExistLabel.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 3
0
        private void CheckBtn_Click(object sender, EventArgs e)
        {
            DataAgent dataAgent = DataAgentFactory.GetDataAgent();
            DataTable dt        = dataAgent.GetExistUser(userIdTextBox.Text);

            if (dt.Rows.Count > 0)
            {
                userNameTextBox.Text     = dt.Rows[0]["nickname"].ToString();
                userExistLabel.Text      = "可以添加此用户!";
                userExistLabel.ForeColor = Color.Green;
            }
            else
            {
                userExistLabel.Text      = "此用户不存在!";
                userExistLabel.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 4
0
 public override void FrozedCmd()
 {
     if (mainToolStrip.Items["FrozedTSButton"].Text == "解冻")
     {
         OMWorkBench.DataAgent.ChangeAgentSatate(OMWorkBench.AgentId, currentAgentId, "解冻", 0);
         _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 0;
         MessageBox.Show("已解冻!");
         SetForFrozed(true);
     }
     else
     {
         DataTable       reasonTable = OMWorkBench.DataAgent.GetStateChangeReason(currentAgentId, 0);
         FrozedAgentForm frozedAgent = new FrozedAgentForm(reasonTable);
         if (frozedAgent.ShowDialog() == DialogResult.OK)
         {
             DataAgent dataAgent = DataAgentFactory.GetDataAgent();
             dataAgent.ChangeAgentSatate(OMWorkBench.AgentId, Convert.ToInt32(AgentDGV.CurrentRow.Cells["id"].Value), frozedAgent.FrozedResonStr, 1);
             _childDS.Tables["organization"].Select("id=" + currentAgentId)[0]["current_state"] = 1;
             SetForFrozed(false);
         }
     }
 }
Ejemplo n.º 5
0
        public LoginForm()
        {
            this.Text = "客户端";
            InitializeComponent();
            this.Text = "登录 :" + DateTime.Today.ToShortDateString();

            dataAgent = DataAgentFactory.GetDataAgent();

            DateTime dt1 = DateTime.Parse("2008-08-08");
            DateTime dt2 = DateTime.Today;
            TimeSpan t   = dt1 - dt2;

            SaveLoginInfo.Text     += "--距离奥运开幕还有" + t.Days + "天";
            SaveLoginInfo.ForeColor = Color.Green;

            if (File.Exists(@"c:\om.xml"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(@"c:\om.xml");
                XmlElement docEle = doc.DocumentElement;
                AgentIDTextBox.Text  = docEle.GetAttribute("agentName");
                userNameTextBox.Text = docEle.GetAttribute("userName");
            }
        }