Ejemplo n.º 1
0
        public async static Task <PRO_tblWarehouseDRO> GetAllWarehouses(string username, string language_id, bool is_combobox, string store_id, string province_id, string district_id, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblWarehouseDRO result = new PRO_tblWarehouseDRO();

            try
            {
                string url = string.Format(@"{0}/GetAllWarehouses?Username={1}&LanguageID={2}&StoreID={3}&ProvinceID={4}&DistrictID={5}&GetCombobox={6}", GetBaseUrl(), username, language_id, store_id, province_id, district_id, is_combobox ? "True" : "False");

                result = await PRO_tblWarehouseDAO.GetAllWarehouses(url);

                if (string.IsNullOrEmpty(result.ResponseItem.Message))
                {
                    if (actionLog != null)
                    {
                        result.ResponseItem = await SYS_tblActionLogBUS.InsertUpdateLog(actionLog);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
                result.ResponseItem.Message = ex.Message;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public async static Task <PRO_tblLevel2DRO> GetAllLevel2(string username, string language_id, string level1_id, bool is_combobox, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblLevel2DRO result = new PRO_tblLevel2DRO();

            try
            {
                string url = string.Format(@"{0}/GetAllLevel2?Username={1}&LanguageID={2}&Level1ID={3}&GetCombobox={4}", GetBaseUrl(), username, language_id, level1_id, is_combobox ? "True" : "False");

                result = await PRO_tblLevel2DAO.GetAllLevel2(url);

                if (string.IsNullOrEmpty(result.ResponseItem.Message))
                {
                    if (actionLog != null)
                    {
                        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 async static Task <PRO_tblStoreDRO> InsertUpdateStore(PRO_tblStoreDTO item, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblStoreDRO result = new PRO_tblStoreDRO();

            try
            {
                string url      = string.Format(@"{0}/InsertUpdateStore", GetBaseUrl());
                var    postData = new PRO_tblStoreDCO
                {
                    StoreID         = item.StoreID,
                    StoreCode       = item.StoreCode,
                    ShortCode       = item.ShortCode,
                    VNName          = item.VNName,
                    ENName          = item.ENName,
                    BuildDate       = item.BuildDate,
                    EndDate         = item.EndDate,
                    AddressVN       = item.AddressVN,
                    AddressEN       = item.AddressEN,
                    Phone           = item.Phone,
                    Fax             = item.Fax,
                    TaxCode         = item.TaxCode,
                    Rank            = item.Rank,
                    Used            = item.Used,
                    IsRoot          = item.IsRoot,
                    Representatives = item.Representatives,
                    Note            = item.Note,
                    Photo           = item.Photo,
                    ProvinceID      = string.IsNullOrEmpty(item.ProvinceID) ? null : item.ProvinceID,
                    DistrictID      = string.IsNullOrEmpty(item.DistrictID) ? null : item.DistrictID,
                    UserID          = item.UserID,
                    Activity        = item.Activity,
                    LanguageID      = item.LanguageID
                };
                var json_data = "{\"store\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                }) + "}";

                result = await PRO_tblStoreDAO.InsertUpdateStore(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.º 4
0
        public async static Task <PRO_tblLevel3DRO> InsertUpdateLevel3(PRO_tblLevel3DTO item, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblLevel3DRO result = new PRO_tblLevel3DRO();

            try
            {
                string url      = string.Format(@"{0}/InsertUpdateLevel3", GetBaseUrl());
                var    postData = new PRO_tblLevel3DCO
                {
                    Level3ID        = item.Level3ID,
                    Level3Code      = item.Level3Code,
                    Level3ShortCode = item.Level3ShortCode,
                    Level1ID        = item.Level1ID,
                    Level2ID        = item.Level2ID,
                    VNName          = item.VNName,
                    ENName          = item.ENName,
                    Rank            = string.IsNullOrEmpty(item.Rank) ? null : item.Rank,
                    Note            = item.Note,
                    Description     = item.Description,
                    Used            = item.Used,
                    Activity        = item.Activity,
                    UserID          = item.UserID,
                    LanguageID      = item.LanguageID
                };
                var json_data = "{\"level3\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                }) + "}";

                result = await PRO_tblLevel3DAO.InsertUpdateLevel3(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.º 5
0
        public async static Task <PRO_tblStallDRO> InsertUpdateStall(PRO_tblStallDTO item, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblStallDRO result = new PRO_tblStallDRO();

            try
            {
                string url      = string.Format(@"{0}/InsertUpdateStall", GetBaseUrl());
                var    postData = new PRO_tblStallDCO
                {
                    StallID     = item.StallID,
                    StallCode   = item.StallCode,
                    VNName      = item.VNName,
                    ENName      = item.ENName,
                    StoreID     = item.StoreID,
                    WarehouseID = item.WarehouseID,
                    Rank        = item.Rank,
                    Used        = item.Used,
                    Note        = item.Note,
                    UserID      = item.UserID,
                    Activity    = item.Activity,
                    LanguageID  = item.LanguageID
                };
                var json_data = "{\"stall\":" + JsonConvert.SerializeObject(postData, new JsonSerializerSettings
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                }) + "}";

                result = await PRO_tblStallDAO.InsertUpdateStall(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.º 6
0
        private async void btnLogin_Click(object sender, EventArgs e)
        {
            if (await CheckLogin())
            {
                string username = (chkRemember.Checked) ? EncryptEngine.Encrypt(txtUsername.Text.Trim()) : "";
                string password = (chkRemember.Checked) ? EncryptEngine.Encrypt(txtPassword.Text.Trim()) : "";
                IOEngine.Write("Initialize", "Username", username);
                IOEngine.Write("Initialize", "Password", password);

                ResponseItem result = await SYS_tblActionLogBUS.InsertUpdateLog(new SYS_tblActionLogDTO
                {
                    ID             = string.Empty,
                    ActionVN       = "Đăng Nhập",
                    ActionEN       = "Login",
                    ActionTime     = DateTime.Now,
                    FunctionID     = string.Empty,
                    FunctionNameVN = "Đăng Nhập",
                    FunctionNameEN = "Login",
                    DescriptionEN  = string.Format("Account '{0}' has logined to system at {1}.", txtUsername.Text, DateTime.Now),
                    DescriptionVN  = string.Format("Tài khoản '{0}' vừa đăng nhập vào hệ thống vào lúc {1}.", txtUsername.Text, DateTime.Now),
                    FullName       = CommonEngine.userInfo.FullName,
                    Activity       = "Insert",
                    UserID         = CommonEngine.userInfo.UserID,
                    LanguageID     = ConfigEngine.Language
                });

                if (result.IsError)
                {
                    CommonEngine.ShowHTTPErrorMessage(result);
                }
                else
                {
                    if (!string.IsNullOrEmpty(result.Message))
                    {
                        CommonEngine.ShowMessage(result.Message, 0);
                        return;
                    }
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 7
0
        public async static Task <PRO_tblLevel2DRO> DeleteLevel2(string username, string language_id, string level2_id_list, SYS_tblActionLogDTO actionLog)
        {
            PRO_tblLevel2DRO result = new PRO_tblLevel2DRO();

            try
            {
                string url = string.Format(@"{0}/DeleteLevel2?Username={1}&LanguageID={2}&Level2IDList={3}", GetBaseUrl(), username, language_id, level2_id_list);

                result = await PRO_tblLevel2DAO.DeleteLevel2(url);

                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);
        }