示例#1
0
        private void MenuClick_Update_Click(object sender, EventArgs e)
        {
            if (Row_Format < 0)
            {
                return;
            }
            if (grd_FormatS.RowCount <= 0)
            {
                return;
            }
            Stock_DocumentFormat GData = (Stock_DocumentFormat)grd_FormatS.GetRow(Row_Format);

            db_Format = new DocumentFormatService(Utility.ConnSDB);
            var item = db_Format.GetFind(GData.Format_Id, GData.Menu_ID);

            //swith_DocGroup.IsOn = Convert.ToBoolean(item.Prefix_Enable);
            txt_DocGroup.Text      = item.Prefix;
            swith_Year.IsOn        = Convert.ToBoolean(item.Year_Enable);
            rdo_YearLen.EditValue  = item.Year_Len == null ? 2 : item.Year_Len;
            swith_Month.IsOn       = Convert.ToBoolean(item.Month_Enable);
            swith_Day.IsOn         = Convert.ToBoolean(item.Day_Enable);
            num_Running.Value      = Convert.ToDecimal(item.Running_Len);
            txt_Description.Text   = item.Description;
            txt_FormatDisplay.Text = item.Stock_DocumentRunning == null ? "" : item.Stock_DocumentRunning.FormatDisplay;
            txt_FormatString.Text  = item.Stock_DocumentRunning == null ? "" : item.Stock_DocumentRunning.FormatString;
            txt_FormatID.Text      = item.Format_Id.ToString();

            btn_Update.Visible = true;
            lbl_Update.Visible = true;
            btn_Save.Visible   = false;
            lbl_New.Visible    = false;
        }
        public static IDocumentFormatService GetDocumentFormatService()
        {
            IDocumentFormatService service = new DocumentFormatService(new HostingEnvironment());

            return(service);
        }