Ejemplo n.º 1
0
 /// <summary>
 /// 新增数据
 /// </summary>
 private void AddData()
 {
     model = new SRDevice.Device()
     {
         DevCCode     = strDevCCode,
         CreateDate   = DateTime.Now,
         CreatePerson = context.UserName
     };
     deviceBindingSource.DataSource = model;
 }
Ejemplo n.º 2
0
        //处理日期控件Null
        //private void StopDateTextEdit_Properties_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        //{
        //    if (e.Value != DBNull.Value)
        //    {
        //        if (e.Value.ToString().IsNullOrEmpty())
        //            e.Value = DBNull.Value;
        //    }
        //}
        #endregion

        #region Method

        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            using (SRDevice.DeviceServiceClient client = new SRDevice.DeviceServiceClient())
            {
                var ret = client.GetDeviceByCode(context.SessionID, strDevCode);
                if (ret.IsSuccess)
                {
                    model = ret.Data;
                    this.Invoke((MethodInvoker) delegate()
                    {
                        deviceBindingSource.DataSource = model;
                    });
                }
                else
                {
                    ClsMsg.ShowErrMsg(ret.Message);
                }
            }
        }