Beispiel #1
0
        public static string DeleteMasterDataSPSH(MasterDataModel.MasterDataSPSH item)
        {
            string res = DbTransaction.DbToString("sp_DeleteMasterDataSPSH",
                                                  new
            {
                SPSH_ID  = item.SPSH_ID,
                UpdateBy = item.UpdateBy
            }, true);

            return(res);
        }
Beispiel #2
0
        protected void gv_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            BootstrapGridView gv = (BootstrapGridView)sender;

            MasterDataModel.MasterDataSPSH item = new MasterDataModel.MasterDataSPSH();
            item.SPSH_ID  = e.Keys[0].ToString();
            item.UpdateBy = UserProfile.Username;

            string res = MasterDataEntity.DeleteMasterDataSPSH(item);

            gv.JSProperties["cpRes"] = res;

            e.Cancel = true;

            gv.DataBind();
        }
Beispiel #3
0
        public static string AddMasterDataSPSH(MasterDataModel.MasterDataSPSH item)
        {
            string res = DbTransaction.DbToString("sp_AddMasterDataSPSH",
                                                  new
            {
                NewSPSH_ID = item.NewSPSH_ID,
                Region_ID  = item.Region_ID,
                Name       = item.Name,
                Address    = item.Address,
                Telp       = item.Telp,
                Email      = item.Email,
                CreationBy = item.CreationBy
            }, true);

            return(res);
        }
Beispiel #4
0
        protected void gv_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            BootstrapGridView gv = (BootstrapGridView)sender;

            MasterDataModel.MasterDataSPSH item = GetGvValue(gv, e.Keys[0].ToString());

            string res = MasterDataEntity.EditMasterDataSPSH(item);

            gv.JSProperties["cpRes"] = res;

            e.Cancel = true;

            if (res.Contains("Success"))
            {
                gv.CancelEdit();
                gv.DataBind();
            }
        }
Beispiel #5
0
        protected MasterDataModel.MasterDataSPSH GetGvValue(BootstrapGridView gv, string key = "")
        {
            BootstrapTextBox  txtSPSH_ID = gv.FindEditFormTemplateControl("txtSPSH_ID") as BootstrapTextBox;
            BootstrapTextBox  txtName    = gv.FindEditFormTemplateControl("txtName") as BootstrapTextBox;
            BootstrapComboBox cmbRegion  = gv.FindEditFormTemplateControl("cmbRegion") as BootstrapComboBox;
            BootstrapMemo     txtAddress = gv.FindEditFormTemplateControl("txtAddress") as BootstrapMemo;
            BootstrapTextBox  txtTelp    = gv.FindEditFormTemplateControl("txtTelp") as BootstrapTextBox;
            BootstrapTextBox  txtEmail   = gv.FindEditFormTemplateControl("txtEmail") as BootstrapTextBox;

            MasterDataModel.MasterDataSPSH item = new MasterDataModel.MasterDataSPSH();
            item.SPSH_ID    = key;
            item.NewSPSH_ID = txtSPSH_ID.Text;
            item.Region_ID  = Convert.ToByte(cmbRegion.Value);
            item.Name       = txtName.Text;
            item.Address    = txtAddress.Text;
            item.Telp       = txtTelp.Text;
            item.Email      = txtEmail.Text;
            item.CreationBy = UserProfile.Username;
            item.UpdateBy   = UserProfile.Username;

            return(item);
        }