private void btnSave_Click(object sender, EventArgs e) { if (Model == null) // add Industrial mode { Model = new models.WarehousememberModel(); //new model to assign data Model.flag = txtFlag.Text.Trim(); // set province id Model.countryCode = txtContryCode.Text.Trim(); //set english name Model.nameEn = txtNameEng.Text.Trim(); // set thai name Model.addr = txtAddress.Text.Trim(); // set japan name Model.tel = txtTel.Text.Trim(); // set search name Model.mob = txtMobile.Text.Trim(); // set province id Model.contactName = txtContract.Text.Trim(); //set english name Model.email = txtEmail.Text.Trim(); // set thai name Model.url = txtURL.Text.Trim(); // set japan name Model.regDate = dtpRegisterDate.Text.Trim(); // set search name Model.expireDate = dtpExpireDate.Text.Trim(); // set thai name Model.updDate = dtpUpdateDate.Text.Trim(); // set japan name Model.searchKey = txtSearch.Text.Trim(); // set search name WarehouseMemberController.InsertData(Model); } else // update (edit) Industrial mode { Model.flag = txtFlag.Text.Trim(); // set province id Model.countryCode = txtContryCode.Text.Trim(); //set english name Model.nameEn = txtNameEng.Text.Trim(); // set thai name Model.addr = txtAddress.Text.Trim(); // set japan name Model.tel = txtTel.Text.Trim(); // set search name Model.mob = txtMobile.Text.Trim(); // set province id Model.contactName = txtContract.Text.Trim(); //set english name Model.email = txtEmail.Text.Trim(); // set thai name Model.url = txtURL.Text.Trim(); // set japan name Model.regDate = dtpRegisterDate.Text.Trim(); // set search name Model.expireDate = dtpExpireDate.Text.Trim(); // set thai name Model.updDate = dtpUpdateDate.Text.Trim(); // set japan name Model.searchKey = txtSearch.Text.Trim(); // set search name WarehouseMemberController.UpdateData(Model); } }
public AddWarehouseMemberForm(models.WarehousememberModel Model) { this.Model = Model; InitializeComponent(); }
public static void UpdateData(models.WarehousememberModel model) { //show message box when cannot insert data MessageBox.Show((models.WarehousememberModel.updateWarehousemember(model)) ? "Insert Success" : "Insert Failed, Please Check parameter or something"); }