示例#1
0
        private void SaveSetting()
        {
            if (this.te_RQ.EditValue == null)
            {
                return;
            }
            string      _dt   = this.te_RQ.EditValue.ToString();
            WC_DataInfo _info = new WC_DataInfo();

            _info.GZ_Date   = new DateTime(int.Parse(_dt.Substring(0, 4)), int.Parse(_dt.Substring(5, 2)), int.Parse(_dt.Substring(8, 2)));
            _info.Year      = _info.GZ_Date.Year;
            _info.Month     = _info.GZ_Date.Month;
            _info.Day       = _info.GZ_Date.Day;
            _info.IsWorkDay = this.te_IsWorkDay.Checked;
            _info.IsTJSBR   = this.te_IsTJSBR.Checked;
            _info.IsFXSBR   = this.te_IsFXSBR.Checked;
            _info.Meta      = (this.te_Des.EditValue == null) ? "" : this.te_Des.EditValue.ToString();
            using (CommonServiceClient _csc = new CommonServiceClient())
            {
                if (_csc.SaveDataInfo(_info))
                {
                    var find = from _c in DateList
                               where _c.GZ_Date == _info.GZ_Date
                               select _c;
                    if (find == null || find.Count() < 1)
                    {
                        this.DateList.Add(_info);
                    }
                    else
                    {
                        WC_DataInfo _wc = find.First();
                        _wc.IsWorkDay = _info.IsWorkDay;
                        _wc.IsFXSBR   = _info.IsFXSBR;
                        _wc.IsTJSBR   = _info.IsTJSBR;
                        _wc.Meta      = _info.Meta;
                    }
                    int _year = int.Parse(this.TE_YEAR.Text);
                    DrawDates(_year);
                }
            }
        }