public PRO_tblStoreDTO GetDataByID(string username, string language_id, string store_id) { PRO_tblStoreDTO result = new PRO_tblStoreDTO(); try { DataTable data = db.GetDataTable("PRO_spfrmStore", new string[] { "Activity", "Username", "LanguageID", "StoreID" }, new object[] { BaseConstant.COMMAND_GET_DATA_BY_ID_EN, username, language_id, store_id }); if (data != null && data.Rows.Count > 0) { result = ConvertEngine.ConvertDataTableToObjectList<PRO_tblStoreDTO>(data)[0]; return result; } } catch (Exception ex) { logger.Error(ex); } return result; }
public string InsertStore(PRO_tblStoreDTO item) { string strError = ""; try { if (string.IsNullOrEmpty(item.Photo)) item.Photo = @"Data\Images\no_image.png"; strError = db.sExecuteSQL("PRO_spfrmStore", new string[] { "Activity", "Username", "LanguageID", "StoreID", "StoreCode", "ShortCode", "VNName", "ENName", "BuildDate", "EndDate", "AddressVN", "AddressEN", "Phone", "Fax", "Rank", "TaxCode", "Used", "IsRoot", "Representives", "Note", "Photo", "ProvinceID", "DistrictID" }, new object[] { item.Activity, item.UserID, item.LanguageID, item.StoreID, item.StoreCode, item.ShortCode, item.VNName, item.ENName, item.BuildDate, item.EndDate, item.AddressVN, item.AddressEN, item.Phone, item.Fax, item.Rank, item.TaxCode, item.Used, item.IsRoot, item.Representatives, item.Note, item.Photo, item.ProvinceID, item.DistrictID }); if (!string.IsNullOrEmpty(strError)) logger.Error(strError); return strError; } catch (Exception ex) { logger.Error(ex); strError = ex.Message; } return strError; }
public uc_StoreDetail(uc_Store _parent_form, PRO_tblStoreDTO item = null) { CommonEngine.ShowWaitForm(this); InitializeComponent(); Initialize(); parent_form = _parent_form; if (item != null) LoadDataToEdit(item); CommonEngine.LoadUserPermission("13", txtStoreID, btnSaveClose, btnSaveInsert); }
private void LoadDataToEdit(PRO_tblStoreDTO item) { txtStoreID.EditValue = (item == null) ? null : item.StoreID; txtStoreCode.EditValue = (item == null) ? null : item.StoreCode; //txtStoreCode.Properties.ReadOnly = (item == null) ? false : true; txtShortCode.EditValue = (item == null) ? null : item.ShortCode; txtVNName.EditValue = (item == null) ? null : item.VNName; txtENName.EditValue = (item == null) ? null : item.ENName; dteBuildDate.EditValue = (item == null) ? null : item.BuildDate; dteEndDate.EditValue = (item == null) ? null : item.EndDate; txtAddressVN.EditValue = (item == null) ? null : item.AddressVN; txtAddressEN.EditValue = (item == null) ? null : item.AddressEN; gluProvince.EditValue = (item == null) ? null : item.ProvinceID; gluDistrict.EditValue = (item == null) ? null : item.DistrictID; txtPhone.EditValue = (item == null) ? null : item.Phone; txtFax.EditValue = (item == null) ? null : item.Fax; txtTaxCode.EditValue = (item == null) ? null : item.TaxCode; speRank.EditValue = (item == null) ? null : item.Rank; txtRepresentives.EditValue = (item == null) ? null : item.Representatives; chkIsRoot.Checked = (item == null) ? false : item.IsRoot; chkUsed.Checked = (item == null) ? true : item.Used; mmoNote.EditValue = (item == null) ? null : item.Note; if (item != null && !string.IsNullOrEmpty(item.PhotoUri)) picPhoto.LoadAsync(item.PhotoUri); else picPhoto.EditValue = null; if (item == null) { depError.ClearErrors(); this.ParentForm.Text = LanguageEngine.GetOpenFormText(this.Name, ConfigEngine.Language, false); txtStoreCode.Focus(); } }