Ejemplo n.º 1
0
        public PRO_tblWarehouseDTO GetDataByID(string username, string language_id, string warehouse_id)
        {
            PRO_tblWarehouseDTO result = new PRO_tblWarehouseDTO();
            try
            {
                DataTable data = db.GetDataTable("PRO_spfrmWarehouse", new string[] { "Activity", "Username", "LanguageID", "WarehouseID" }, new object[] { BaseConstant.COMMAND_GET_DATA_BY_ID_EN, username, language_id, warehouse_id });
                if (data != null && data.Rows.Count > 0)
                {
                    result = ConvertEngine.ConvertDataTableToObjectList<PRO_tblWarehouseDTO>(data)[0];
                    return result;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }

            return result;
        }
Ejemplo n.º 2
0
        public async static Task<PRO_tblWarehouseDRO> InsertUpdateStore(PRO_tblWarehouseDTO item, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblWarehouseDRO result = new PRO_tblWarehouseDRO();
            try
            {
                string url = string.Format(@"{0}/InsertUpdateWarehouse", GetBaseUrl());
                var postData = new PRO_tblWarehouseDCO
                {
                    WarehouseID = item.WarehouseID,
                    WarehouseCode = item.WarehouseCode,
                    VNName = item.VNName,
                    ENName = item.ENName,
                    StoreID = item.StoreID,
                    AddressVN = item.AddressVN,
                    AddressEN = item.AddressEN,
                    Phone = item.Phone,
                    Fax = item.Fax,
                    ProvinceID = string.IsNullOrEmpty(item.ProvinceID) ? null : item.ProvinceID,
                    DistrictID = string.IsNullOrEmpty(item.DistrictID) ? null : item.DistrictID,
                    Rank = item.Rank,
                    Used = item.Used,
                    Note = item.Note,
                    UserID = item.UserID,
                    Activity = item.Activity,
                    LanguageID = item.LanguageID
                };
                var json_data = "{\"warehouse\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                }) + "}";

                result = await PRO_tblWarehouseDAO.InsertUpdateWarehouse(url, json_data);
                if (string.IsNullOrEmpty(result.ResponseItem.Message)) result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog);
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                result.ResponseItem.Message = ex.Message;
            }

            return result;
        }
Ejemplo n.º 3
0
 public uc_WarehouseDetail(uc_Warehouse _parent_form, PRO_tblWarehouseDTO item = null)
 {
     CommonEngine.ShowWaitForm(this);
     InitializeComponent();
     Initialize();
     parent_form = _parent_form;
     if (item != null)
         LoadDataToEdit(item);
     CommonEngine.LoadUserPermission("18", txtWarehouseID, btnSaveClose, btnSaveInsert);
 }
Ejemplo n.º 4
0
 private void LoadDataToEdit(PRO_tblWarehouseDTO item)
 {
     txtWarehouseID.EditValue = (item == null) ? null : item.WarehouseID;
     txtWarehouseCode.EditValue = (item == null) ? null : item.WarehouseCode;
     //txtWarehouseCode.Properties.ReadOnly = (item == null) ? false : true;
     txtVNName.EditValue = (item == null) ? null : item.VNName;
     txtENName.EditValue = (item == null) ? null : item.ENName;
     gluStore.EditValue = (item == null) ? null : item.StoreID;
     txtAddressEN.EditValue = (item == null) ? null : item.AddressEN;
     txtAddressVN.EditValue = (item == null) ? null : item.AddressVN;
     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;
     speRank.EditValue = (item == null) ? null : item.Rank;
     chkUsed.Checked = (item == null) ? true : item.Used;
     mmoNote.EditValue = (item == null) ? null : item.Note;
     if (item == null)
     {
         depError.ClearErrors();
         this.ParentForm.Text = LanguageEngine.GetOpenFormText(this.Name, ConfigEngine.Language, false);
         txtWarehouseCode.Focus();
     }
 }
Ejemplo n.º 5
0
        public string InsertWarehouse(PRO_tblWarehouseDTO item)
        {
            string strError = "";
            try
            {
                strError = db.sExecuteSQL("PRO_spfrmWarehouse", new string[] { "Activity", "Username", "LanguageID", "WarehouseID", "WarehouseCode", "VNName", "ENName", "AddressVN", "AddressEN", "Phone", "Fax", "Rank", "Used", "Note", "StoreID", "ProvinceID", "DistrictID" }, new object[] { item.Activity, item.UserID, item.LanguageID, item.WarehouseID, item.WarehouseCode, item.VNName, item.ENName, item.AddressVN, item.AddressEN, item.Phone, item.Fax, item.Rank, item.Used, item.Note, item.StoreID, item.ProvinceID, item.DistrictID });

                if (!string.IsNullOrEmpty(strError))
                    logger.Error(strError);

                return strError;
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                strError = ex.Message;
            }

            return strError;
        }