Example #1
0
        public override void NewCmd()
        {
            CommunicateForm comForm = new CommunicateForm();

            if (comForm.ShowDialog() == DialogResult.OK)
            {
                DataRow newRow = communicateLogTable.NewRow();
                newRow["manager_id"]       = _managerId;
                newRow["communicate_time"] = DateTime.Now;
                if (_agentId > -1)
                {
                    newRow["organization_id"]  = _agentId;
                    newRow["communicate_type"] = 1;
                }
                else if (_userId > -1)
                {
                    newRow["user_id"]          = _userId;
                    newRow["communicate_type"] = 2;
                }

                newRow["description"] = comForm.Context;
                communicateLogTable.LoadDataRow(newRow.ItemArray, false);
                int i = OMWorkBench.DataAgent.UpdateCommunicateLog(communicateLogTable.GetChanges());
                communicateLogTable.AcceptChanges();
                if (_agentId > -1)
                {
                    communicateLogTable = OMWorkBench.DataAgent.GetCommunicateLog(_agentId, -1, _managerId);
                }
                else
                {
                    communicateLogTable = OMWorkBench.DataAgent.GetCommunicateLog(-1, _userId, _managerId);
                }
            }
        }
Example #2
0
        public override void EditCmd()
        {
            CommunicateForm comForm = new CommunicateForm();

            comForm.Context = communicateLogDGV.CurrentRow.Cells["comContent"].Value.ToString();
            if (comForm.ShowDialog() == DialogResult.OK)
            {
                DataRow newRow = communicateLogTable.Rows[communicateLogDGV.CurrentRow.Index];
                newRow["communicate_time"] = DateTime.Now;
                newRow["description"]      = comForm.Context;
                int i = OMWorkBench.DataAgent.UpdateCommunicateLog(communicateLogTable.GetChanges());
                communicateLogTable.AcceptChanges();
                _logBDS.DataSource = communicateLogTable;
            }
        }
Example #3
0
        private void addCommunicateBtn_Click(object sender, EventArgs e)
        {
            CommunicateForm comForm             = new CommunicateForm();
            DataTable       communicateLogTable = OMWorkBench.DataAgent.GetCommunicateLog(-1, -1, -1);

            if (comForm.ShowDialog() == DialogResult.OK)
            {
                DataRow newRow = communicateLogTable.NewRow();
                newRow["manager_id"]       = OMWorkBench.MangerId;
                newRow["communicate_time"] = DateTime.Now;
                newRow["user_id"]          = _userId;
                newRow["communicate_type"] = 2;
                newRow["description"]      = comForm.Context;

                communicateLogTable.LoadDataRow(newRow.ItemArray, false);
                int i = OMWorkBench.DataAgent.UpdateCommunicateLog(communicateLogTable.GetChanges());
                communicateLogTable.AcceptChanges();
            }
        }