Esempio n. 1
0
 public void Clear()
 {
     myInfo.Clear();
     dtmCreatim = System.DateTime.Now;
     dtmRevtim  = DateTime.Now;
     dtmPrintim = DateTime.Now;
     dtmBuptim  = DateTime.Now;
 }
Esempio n. 2
0
        private void Copy(System.Collections.Specialized.StringDictionary dst, Dictionary <string, string> src)
        {
            dst.Clear();
            List <string> missing = new List <string>();

            foreach (var v in src)
            {
                if (string.IsNullOrEmpty(v.Value))
                {
                    missing.Add(v.Key);
                }
                else
                {
                    dst[v.Key.ToUpper()] = resolve(v.Value);
                }
            }

            if (missing.Count != 0)
            {
                throw new Exception("Missing " + new StringListCombiner(", ", " and ", "none").combine(missing));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="RtnValue"></param>
        public override void SetModifyProc(ref int RtnValue)
        {
            base.SetModifyProc(ref RtnValue);
            try
            {
                Common.AdoConnect.Connect.CreateSqlTransaction();
                m_dicItemData = new System.Collections.Specialized.StringDictionary();
                m_dicPrimarName.Clear();
                m_dicItemData.Clear();
                string str_id = txtID.Text.ToString();
                //***********免许表数据修改*********
                m_dicPrimarName["ID"] = str_id;

                m_dicItemData["UserID"] = txtUserID.Text.ToString();//用户id
                m_dicItemData["LicenseType"] = lookUpEditLicenseType.EditValue.ToString();//免许类型
                m_dicItemData["ValidDate"] = dateEditDate.EditValue.ToString();//有效日期
                m_dicItemData["OperID"] = Common._personid;//
                m_dicItemData["OperDate"] = DateTime.Now.ToString();//
                int result = SysParam.m_daoCommon.SetModifyDataIdentityColumn("License_Rec_i", m_dicItemData, m_dicPrimarName);

                m_dicPrimarName.Clear();
                m_dicItemData.Clear();
                m_dicPrimarName["ID"] = str_id;
                m_dicItemData["ID"] = str_id;

                //***********免许明细数据删除*********
                result = SysParam.m_daoCommon.SetDeleteDataItem("P_License_Detail", m_dicItemData, m_dicPrimarName);
                //***********免许资格数据删除*********
                m_dicPrimarName.Clear();
                m_dicItemData.Clear();
                m_dicPrimarName["RecID"] = str_id;
                m_dicItemData["RecID"] = str_id;
                result = SysParam.m_daoCommon.SetDeleteDataItem("P_License_Rec_Entitle", m_dicItemData, m_dicPrimarName);


                //***********免许资格数据插入*********
                List<string> Entitle_ls = new List<string>();
                //保存用户免许资格
                for (int j = 0; j < lookEntitle.Properties.Items.Count; j++)
                {
                    CheckedListBoxItem item = lookEntitle.Properties.Items[j];
                    if (item.CheckState == CheckState.Checked)
                    {
                        Entitle_ls.Add(item.Value.ToString());
                    }
                }

                m_dicPrimarName.Clear();
                m_dicItemData.Clear();
                for (int j = 0; j < Entitle_ls.Count; j++)//
                {
                    m_dicItemData["RecID"] = str_id;
                    m_dicItemData["EntitleID"] = Entitle_ls[j];
                    SysParam.m_daoCommon.SetInsertDataItem("P_License_Rec_Entitle", m_dicItemData);
                }


                //***********免许明细数据插入*********
                DataTable dt_temp = ((DataView)gridView1.DataSource).ToTable();
                for (int i = 0; i < dt_temp.Rows.Count; i++)
                {
                    m_dicPrimarName.Clear();
                    m_dicItemData.Clear();
                    m_dicPrimarName["ID"] = str_id;
                    m_dicItemData["ID"] = str_id;


                    DataView view = new DataView(m_tblJobForID.Copy());
                    view.RowFilter = "JobForName='" + dt_temp.Rows[i]["JobForName"].ToString() + "'";
                    m_dicItemData["JobForID"] = view.ToTable().Rows[0]["JobForID"].ToString();//向别
                    view = new DataView(m_tblProjectID.Copy());
                    view.RowFilter = "ProjectName='" + dt_temp.Rows[i]["ProjectName"].ToString() + "'";
                    m_dicItemData["ProjectID"] = view.ToTable().Rows[0]["ProjectID"].ToString();//工程别
                    view = new DataView(m_tblLineID.Copy());
                    view.RowFilter = "LineName='" + dt_temp.Rows[i]["LineName"].ToString() + "'";
                    m_dicItemData["LineID"] = view.ToTable().Rows[0]["LineID"].ToString();//Line别
                    view = new DataView(m_tblGuanweiID.Copy());
                    view.RowFilter = "guanweiName='" + dt_temp.Rows[i]["guanweiName"].ToString() + "'";
                    m_dicItemData["guanweiID"] = view.ToTable().Rows[0]["guanweiID"].ToString();//关位

                    m_dicItemData["position"] = dt_temp.Rows[i]["position"].ToString();//位置

                    view = new DataView(m_tblSID.Copy());
                    view.RowFilter = "pName='" + dt_temp.Rows[i]["levelName"].ToString() + "'";
                    m_dicItemData["level"] = view.ToTable().Rows[0]["ID"].ToString();//关位


                    //操作员
                    m_dicItemData["OperID"] = Common._personid;
                    //操时间
                    m_dicItemData["OperDate"] = DateTime.Now.ToString();
                    result = SysParam.m_daoCommon.SetInsertDataItem("P_License_Detail", m_dicItemData);
                }


                if (result > 0)
                {
                    Common.AdoConnect.Connect.TransactionCommit();
                    XtraMsgBox.Show("修改数据成功!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //日志
                    SysParam.m_daoCommon.WriteLog("免许登记", "修改", txtUserID.Text.ToString());
                    DialogResult = DialogResult.OK;
                }
                txtGuanwei.Focus();
            }
            catch (Exception ex)
            {
                log.Error(ex);
                Common.AdoConnect.Connect.TransactionRollback();
                throw ex;
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Clears the property dictionary. Useful if the serialization info should be used to serialize multiple values.
 /// If you clear the properties before the serialization of each value, the serialization behaves as if each value is
 /// serialized independent of each other.
 /// </summary>
 public void ClearProperties()
 {
     m_Properties.Clear();
 }