override protected Boolean LoadData() { try { // Load Data For Page. DACustomerGroup daCustomerGroup = new DACustomerGroup(); daCustomerGroup.USP_CustomerGroup_GetFullID(this.KeyID); // fCustomerGroup.Value = daCustomerGroup.fCustomerGroup.ToString(); fDescription.Value = daCustomerGroup.fDescription.ToString(); // // Khi cần enabled cột nào //if (this.KeyID > 0) //{ // if (mode != Act.Clone) // fUserName.Enabled = false; // else // fUserName.Text = ""; //} } catch (Exception e) { ShowErrorMes("Lỗi hệ thống: " + e.ToString()); return(false); } return(true); }
override protected Boolean GetDataComboBox() { try { DAOrderStatus daOrderStatus = new DAOrderStatus(); fOrderStatusID.DataSource = daOrderStatus.USP_OrderStatus_GetDataForComboBox(); fOrderStatusID.DataBind(); DAPayment daPayment = new DAPayment(); fPaymentID.DataSource = daPayment.USP_Payment_GetDataForComboBox(); fPaymentID.DataBind(); DAShipping daShipping = new DAShipping(); fShippingID.DataSource = daShipping.USP_Shipping_GetDataForComboBox(); fShippingID.DataBind(); DAProvince daProvinceBilling = new DAProvince(); fBillProvinceID.DataSource = daProvinceBilling.USP_Province_GetDataForComboBox(); fBillProvinceID.DataBind(); DADistrict daDistrictBilling = new DADistrict(); fBillDistrictID.DataSource = daDistrictBilling.USP_District_GetDataForComboBox_ByProvinceID(int.Parse(fBillProvinceID.SelectedValue)); fBillDistrictID.DataBind(); DAProvince daProvinceShipping = new DAProvince(); fShipProvinceID.DataSource = daProvinceShipping.USP_Province_GetDataForComboBox(); fShipProvinceID.DataBind(); DADistrict daDistrictShipping = new DADistrict(); fShipDistrictID.DataSource = daDistrictShipping.USP_District_GetDataForComboBox_ByProvinceID(int.Parse(fShipProvinceID.SelectedValue)); fShipDistrictID.DataBind(); DACustomer daCustomer = new DACustomer(); fCustomerID.DataSource = daCustomer.USP_Customer_GetDataForComboBox(); fCustomerID.DataBind(); DAProvince daProvince = new DAProvince(); fProvinceID.DataSource = daProvince.USP_Province_GetDataForComboBox(); fProvinceID.DataBind(); DACustomerGroup daCustomerGroup = new DACustomerGroup(); fCustomerGroupID.DataSource = daCustomerGroup.USP_CustomerGroup_GetDataForComboBox(); fCustomerGroupID.DataBind(); //LoadCategory(); return(true); } catch (Exception ex) { ShowErrorMes("Lỗi hệ thống: " + ex.Message); return(false); } }
override protected int DeleteByID(int pID) { try { DACustomerGroup DACustomerGroup = new DACustomerGroup(); DACustomerGroup.USP_CustomerGroup_Delete(pID); return(1); } catch { return(0); } }
private DACustomerGroup CreateObjectFromPage() { // check DACustomerGroup daCustomerGroup = new DACustomerGroup(); // daCustomerGroup.fCustomerGroup = fCustomerGroup.Value.Trim(); daCustomerGroup.fDescription = fDescription.Value.Trim(); // return(daCustomerGroup); }
override protected int ExecUpdate() { // Update with ID = this.ID try { DACustomerGroup DACustomerGroup = CreateObjectFromPage(); DACustomerGroup.fID = this.KeyID; DACustomerGroup.USP_CustomerGroup_Update(); return(1); } catch { return(0); } }
override protected int ExecInsert() { try { DACustomerGroup DACustomerGroup = CreateObjectFromPage(); if (this.mode == ActParam.New) { DACustomerGroup.fID = DACustomerGroup.USP_GetKey(); this.KeyID = DACustomerGroup.fID; // --> Update new SessionID for continue edit. } else { DACustomerGroup.fID = 0; } DACustomerGroup.USP_CustomerGroup_Insert(); return(1); } catch { return(0); } }
override protected Boolean GetDataComboBox() { try { DAProvince daProvince = new DAProvince(); fProvinceID.DataSource = daProvince.USP_Province_GetDataForComboBox(); fProvinceID.DataBind(); daProvince.CloseAll(); DACustomerGroup daCustomerGroup = new DACustomerGroup(); fCustomerGroupID.DataSource = daCustomerGroup.USP_CustomerGroup_GetDataForComboBox(); fCustomerGroupID.DataBind(); return(true); } catch (Exception ex) { ShowErrorMes("Lỗi hệ thống: " + ex.Message); return(false); } }