Example #1
0
        public void Save()
        {
            int userID = GlobalFacade.SystemContext.GetContext().UserID;

            BusinessMapping.CWFamilySpecHelp bo = new BusinessMapping.CWFamilySpecHelp();
            bo.SessionInstance = new Wicresoft.Session.Session();

            if (this.gpCWInfo.SelectedValue != string.Empty && this.gpCWInfo.SelectedValue != "0")
            {
                bo.FK_CWID.Value = Convert.ToInt32(this.gpCWInfo.SelectedValue);
            }

            bo.AppIDCardNo.Value = this.txtAppIDCardNo.Text.Trim();
            bo.AppName.Value     = this.txtAppName.Text.Trim();
            if (this.ddlSex.SelectedValue != string.Empty && this.ddlSex.SelectedValue != "0")
            {
                bo.Sex.Value = Convert.ToInt32(this.ddlSex.SelectedValue);
            }

            if (this.ddlHolderPorp.SelectedValue != "" && this.ddlHolderPorp.SelectedValue != "0")
            {
                bo.HolderPorp.Value = Convert.ToInt32(this.ddlHolderPorp.SelectedValue);
            }

            if (this.ddlHelpType.SelectedValue != "" && this.ddlHelpType.SelectedValue != "0")
            {
                bo.HelpType.Value = Convert.ToInt32(this.ddlHelpType.SelectedValue);
            }

            if (this.txtRealMonth.Text.Trim() != "")
            {
                bo.RealMonth.Value = Convert.ToInt32(this.txtRealMonth.Text.Trim());
            }

            if (this.txtHelpMoney.Text.Trim() != "")
            {
                bo.HelpMoney.Value = Convert.ToDecimal(this.txtHelpMoney.Text.Trim());
            }

            bo.HelpNo.Value   = this.txtHelpNo.Text.Trim();
            bo.HelpYear.Value = this.txtHelpYear.Text.Trim();

            bo.CreateUser.Value = userID;
            bo.CreateTime.Value = DateTime.Now;
            bo.Memo.Value       = this.txtMemo.Text.Trim();

            bo.Insert();
        }
        private void btnDel_Click(object sender, ImageClickEventArgs e)
        {
            string PKID;
            int    selectedIndex = -1;

            foreach (DataGridItem item in this.dgCWFamilySpecHelp.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                {
                    if (((System.Web.UI.WebControls.RadioButton)item.Cells[0].Controls[1]).Checked)
                    {
                        selectedIndex = item.ItemIndex;
                        break;
                    }
                }
            }

            if (selectedIndex != -1)
            {
                PKID = this.dgCWFamilySpecHelp.Items[selectedIndex].Cells[1].Text;
                Wicresoft.Session.Session        session = new Wicresoft.Session.Session();
                BusinessMapping.CWFamilySpecHelp bo      = new BusinessMapping.CWFamilySpecHelp();
                bo.SessionInstance = session;

                BusinessFilter filter = new BusinessFilter("CWFamilySpecHelp");
                filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
                bo.AddFilter(filter);
                bo.Load();

                if (bo.HaveRecord)
                {
                    bo.IsValid.Value = false;
                    bo.Update();

                    // Reload Data
                    ucCustomPaging.LoadData(ucCustomPaging.CurrentPage);
                }
            }
        }
Example #3
0
        public void LoadBaseInfo(int pkid)
        {
            BusinessMapping.CWFamilySpecHelp bo = new BusinessMapping.CWFamilySpecHelp();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("CWFamilySpecHelp");

            filter.AddFilterItem("PKID", pkid.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                if (bo.FK_CWID.Value > 0)
                {
                    this.gpCWInfo.SelectedValue = bo.FK_CWID.Value.ToString();
                }
                this.txtAppIDCardNo.Text = bo.AppIDCardNo.Value;
                this.txtAppName.Text     = bo.AppName.Value;
                if (bo.Sex.Value > 0)
                {
                    this.ddlSex.SelectedValue = bo.Sex.Value.ToString();
                }
                if (bo.HolderPorp.Value > 0)
                {
                    this.ddlHolderPorp.Text = bo.HolderPorp.Value.ToString();
                }
                if (bo.HelpType.Value > 0)
                {
                    this.ddlHelpType.Text = bo.HelpType.Value.ToString();
                }
                this.txtRealMonth.Text = bo.RealMonth.Value.ToString();
                this.txtHelpMoney.Text = bo.HelpMoney.Value.ToString();
                this.txtHelpNo.Text    = bo.HelpNo.Value;
                this.txtHelpYear.Text  = bo.HelpYear.Value;
                this.txtMemo.Text      = bo.Memo.Value;
            }
        }
Example #4
0
        public void Update()
        {
            BusinessMapping.CWFamilySpecHelp bo = new BusinessMapping.CWFamilySpecHelp();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("CWFamilySpecHelp");

            filter.AddFilterItem("PKID", this.PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);

            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                int userID = GlobalFacade.SystemContext.GetContext().UserID;

                if (this.gpCWInfo.SelectedValue != string.Empty && this.gpCWInfo.SelectedValue != "0")
                {
                    bo.FK_CWID.Value = Convert.ToInt32(this.gpCWInfo.SelectedValue);
                }
                else
                {
                    bo.FK_CWID.Value = 0;
                }

                bo.AppIDCardNo.Value = this.txtAppIDCardNo.Text.Trim();
                bo.AppName.Value     = this.txtAppName.Text.Trim();
                if (this.ddlSex.SelectedValue != string.Empty && this.ddlSex.SelectedValue != "0")
                {
                    bo.Sex.Value = Convert.ToInt32(this.ddlSex.SelectedValue);
                }
                else
                {
                    bo.Sex.Value = 0;
                }

                if (this.ddlHolderPorp.SelectedValue != "" && this.ddlHolderPorp.SelectedValue != "0")
                {
                    bo.HolderPorp.Value = Convert.ToInt32(this.ddlHolderPorp.SelectedValue);
                }
                else
                {
                    bo.HolderPorp.Value = 0;
                }

                if (this.ddlHelpType.SelectedValue != "" && this.ddlHelpType.SelectedValue != "0")
                {
                    bo.HelpType.Value = Convert.ToInt32(this.ddlHelpType.SelectedValue);
                }
                else
                {
                    bo.HelpType.Value = 0;
                }

                if (this.txtRealMonth.Text.Trim() != "")
                {
                    bo.RealMonth.Value = Convert.ToInt32(this.txtRealMonth.Text.Trim());
                }

                if (this.txtHelpMoney.Text.Trim() != "")
                {
                    bo.HelpMoney.Value = Convert.ToDecimal(this.txtHelpMoney.Text.Trim());
                }

                bo.HelpNo.Value   = this.txtHelpNo.Text.Trim();
                bo.HelpYear.Value = this.txtHelpYear.Text.Trim();

                bo.Memo.Value = this.txtMemo.Text.Trim();

                bo.Update();
            }
        }