예제 #1
0
파일: CWInfo.ascx.cs 프로젝트: Jhubbs86/POS
        public void LoadBaseInfo(int pkid)
        {
            BusinessMapping.CWInfo bo = new BusinessMapping.CWInfo();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("CWInfo");

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

            if (bo.HaveRecord)
            {
                txtVillageName.Text = bo.VillageName.Value;
                txtLocation.Text    = bo.Location.Value;
                if (bo.District.Value > 0)
                {
                    ddlDistrict.SelectedValue = bo.District.Value.ToString();
                }
                if (bo.TotalPeps.Value > 0)
                {
                    txtTotalPeps.Text = bo.TotalPeps.Value.ToString();
                }
                if (bo.IndusValue.Value > 0)
                {
                    txtIndusValue.Text = bo.IndusValue.Value.ToString();
                }
                txtVillageChief.Text = bo.VillageChief.Value;
                txtMemo.Text         = bo.Memo.Value;
            }
        }
예제 #2
0
파일: CWInfo.ascx.cs 프로젝트: Jhubbs86/POS
        public void Save()
        {
            int userID = GlobalFacade.SystemContext.GetContext().UserID;

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

            bo.VillageName.Value = this.txtVillageName.Text.Trim();
            bo.Location.Value    = this.txtLocation.Text.Trim();
            if (this.ddlDistrict.SelectedValue != "" && this.ddlDistrict.SelectedValue != "0")
            {
                bo.District.Value = Convert.ToInt32(this.ddlDistrict.SelectedValue);
            }

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

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

            bo.VillageChief.Value = this.txtVillageChief.Text.Trim();

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

            bo.CreateTime.Value = DateTime.Now;
            bo.CreateUser.Value = userID;

            bo.Insert();
        }
예제 #3
0
파일: CWInfo.ascx.cs 프로젝트: Jhubbs86/POS
        public void Update()
        {
            BusinessMapping.CWInfo bo = new BusinessMapping.CWInfo();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("CWInfo");

            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;

                bo.VillageName.Value = this.txtVillageName.Text.Trim();
                bo.Location.Value    = this.txtLocation.Text.Trim();
                if (this.ddlDistrict.SelectedValue != "" && this.ddlDistrict.SelectedValue != "0")
                {
                    bo.District.Value = Convert.ToInt32(this.ddlDistrict.SelectedValue);
                }
                else
                {
                    bo.District.Value = 0;
                }

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

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

                bo.VillageChief.Value = this.txtVillageChief.Text.Trim();

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

                bo.ModifyTime.Value = DateTime.Now;
                bo.ModifyUser.Value = userID;

                bo.Update();
            }
        }
예제 #4
0
        private void btnDel_Click(object sender, ImageClickEventArgs e)
        {
            string PKID;
            int    selectedIndex = -1;

            foreach (DataGridItem item in this.dgCWInfo.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.dgCWInfo.Items[selectedIndex].Cells[1].Text;
                Wicresoft.Session.Session session = new Wicresoft.Session.Session();
                BusinessMapping.CWInfo    bo      = new BusinessMapping.CWInfo();
                bo.SessionInstance = session;

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

                if (bo.HaveRecord)
                {
                    bo.ModifyUser.Value = GlobalFacade.SystemContext.GetContext().UserID;
                    bo.ModifyTime.Value = DateTime.Now;
                    bo.IsValid.Value    = false;
                    bo.Update();

                    // Reload Data
                    ucCustomPaging.LoadData(ucCustomPaging.CurrentPage);
                }
            }
        }