Beispiel #1
0
        public Models.OrderTaxInBranchResultDo GetOrderTaxInBranch(Models.OrderTaxCriteriaDo criteria)
        {
            Models.OrderTaxInBranchResultDo result = new Models.OrderTaxInBranchResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_FE_Get_OrderTaxInBranch]";

                command.AddParameter(typeof(string), "FrontEndID", criteria.FrontEndID);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(int), "SHIFT", criteria.SHIFT);
                command.AddParameter(typeof(int), "OrderID", criteria.OrderID);
                command.AddParameter(typeof(int), "OrderTaxID", criteria.OrderTaxID);

                command.AddParameter(typeof(string), "TaxType", criteria.TaxType);
                command.AddParameter(typeof(DateTime), "CreateDate", criteria.CreateDate);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                result.OrderTax = command.ToObject <Models.OrderTaxInBranchDo>();
                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #2
0
        public Models.OrderTaxResultDo GetOrderTaxList(Models.OrderTaxCriteriaDo criteria)
        {
            Models.OrderTaxResultDo result = new Models.OrderTaxResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Get_OrderTaxList]";

                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(DateTime), "CreateDateFrom", criteria.CreateDateFrom);
                command.AddParameter(typeof(DateTime), "CreateDateTo", criteria.CreateDateTo);
                command.AddParameter(typeof(string), "CustomerName", criteria.CustomerName);
                command.AddParameter(typeof(string), "TaxNo", criteria.TaxNo);
                command.AddParameter(typeof(bool), "IsExport", criteria.IsExport);
                command.AddParameter(typeof(bool), "IsNotExport", criteria.IsNotExport);
                command.AddParameter(typeof(bool), "TaxTypeIV", criteria.TaxTypeIV);
                command.AddParameter(typeof(bool), "TaxTypeAB", criteria.TaxTypeAB);

                Utils.SQL.ISQLDbParameter output  = command.AddSearchParameter(criteria);
                Utils.SQL.ISQLDbParameter summary = command.AddOutputParameter(typeof(int), "SummaryValue");

                result.Rows = command.ToList <Models.OrderTaxFSDo>();
                result.TotalRecordParameter(output);

                if (summary != null)
                {
                    result.SummaryValue = (int)summary.Value;
                }
            }));

            return(result);
        }
Beispiel #3
0
        public Models.SummaryMarketingSalesResultDo GetSummaryMarketingSales(Models.SummarySalesCriteriaDo criteria)
        {
            Models.SummaryMarketingSalesResultDo result = new Models.SummaryMarketingSalesResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Get_SummaryMarketingSales]";

                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(string), "Duration", criteria.Duration);
                command.AddParameter(typeof(DateTime), "RangeDateTimeFrom", criteria.RangeDateTimeFrom);
                command.AddParameter(typeof(DateTime), "RangeDateTimeTo", criteria.RangeDateTimeTo);
                command.AddParameter(typeof(DateTime), "RangeDateFrom", criteria.RangeDateFrom);
                command.AddParameter(typeof(DateTime), "RangeDateFromTime", criteria.RangeDateFromTime);
                command.AddParameter(typeof(DateTime), "RangeDateTo", criteria.RangeDateTo);
                command.AddParameter(typeof(DateTime), "RangeDateToTime", criteria.RangeDateToTime);
                command.AddParameter(typeof(DateTime), "RangeMonth", criteria.RangeMonth);
                command.AddParameter(typeof(DateTime), "RangeYear", criteria.RangeYear);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria, false, false);

                result.Rows = command.ToList <Models.SummaryMarketingSalesDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #4
0
        public Models.UpdateMenuGroupResultDo CreateMenuGroup(Models.MenuGroupDo entity)
        {
            Models.UpdateMenuGroupResultDo result = new Models.UpdateMenuGroupResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Create_MenuGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "Code", entity.Code);
                command.AddParameter(typeof(string), "Name", entity.Name);

                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);
                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                List <Models.MenuGroupDo> list = command.ToList <Models.MenuGroupDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result.Group = list[0];
                    }
                }
                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #5
0
        public Models.UpdateMenuResultDo UpdateMenu(Models.UpdateMenuDo entity)
        {
            Models.UpdateMenuResultDo result = new Models.UpdateMenuResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Update_Menu]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", entity.GroupID);
                command.AddParameter(typeof(int), "CategoryID", entity.CategoryID);

                string subCategoryXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MenuSubCategoryDo>(entity.SubCategories);
                command.AddParameter(typeof(string), "MenuSubCategoryXML", subCategoryXml);

                string menuXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MenuDo>(entity.Menus);
                command.AddParameter(typeof(string), "MenuXML", menuXml);

                string brandXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MenuBrandDo>(entity.Brands);
                command.AddParameter(typeof(string), "MenuBrandXML", brandXml);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                command.ExecuteNonQuery();
                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #6
0
        public Models.MemberResultDo GetMemberList(Models.MemberCriteriaDo criteria)
        {
            Models.MemberResultDo result = new Models.MemberResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_MemberList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "MemberCode", criteria.MemberCode);
                command.AddParameter(typeof(int), "MemberTypeID", criteria.MemberTypeID);
                command.AddParameter(typeof(string), "FirstName", criteria.FirstName);
                command.AddParameter(typeof(string), "LastName", criteria.LastName);
                command.AddParameter(typeof(string), "Email", criteria.Email);
                command.AddParameter(typeof(string), "TelNo", criteria.TelNo);
                command.AddParameter(typeof(DateTime), "RegisterDateFrom", criteria.RegisterDateFrom);
                command.AddParameter(typeof(DateTime), "RegisterDateTo", criteria.RegisterDateTo);
                command.AddParameter(typeof(DateTime), "BirthDateFrom", criteria.BirthDateFrom);
                command.AddParameter(typeof(DateTime), "BirthDateTo", criteria.BirthDateTo);
                command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive);
                command.AddParameter(typeof(int), "RenewTime", criteria.RenewTime);
                command.AddParameter(typeof(int), "ExpireStatus", criteria.ExpireStatus);
                command.AddParameter(typeof(DateTime), "ExpireDateFrom", criteria.ExpireDateFrom);
                command.AddParameter(typeof(DateTime), "ExpireDateTo", criteria.ExpireDateTo);
                command.AddParameter(typeof(DateTime), "CurrentDate", criteria.CurrentDate);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.MemberFSDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #7
0
        public Models.UpdateBranchResultDo CreateBranch(Models.BranchDo entity)
        {
            Models.UpdateBranchResultDo result = new Models.UpdateBranchResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Create_Branch]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "BrandCode", entity.BrandCode);
                command.AddParameter(typeof(string), "BranchCode", entity.BranchCode);
                command.AddParameter(typeof(string), "BranchName", entity.BranchName);
                command.AddParameter(typeof(string), "BranchShortNameEN", entity.BranchShortNameEN);
                command.AddParameter(typeof(string), "BranchShortNameTH", entity.BranchShortNameTH);
                command.AddParameter(typeof(string), "LocationCode", entity.LocationCode);
                command.AddParameter(typeof(string), "BranchAddress", entity.BranchAddress);
                command.AddParameter(typeof(string), "BillHeader", entity.BillHeader);
                command.AddParameter(typeof(string), "ProvinceID", entity.ProvinceID);
                command.AddParameter(typeof(string), "CantonID", entity.CantonID);
                command.AddParameter(typeof(string), "DistrictID", entity.DistrictID);
                command.AddParameter(typeof(string), "ZipCode", entity.ZipCode);
                command.AddParameter(typeof(string), "TelNo", entity.TelNo);
                command.AddParameter(typeof(string), "FaxNo", entity.FaxNo);
                command.AddParameter(typeof(int), "TemplateID", entity.TemplateID);
                command.AddParameter(typeof(string), "TaxID", entity.TaxID);
                command.AddParameter(typeof(string), "TaxBranchCode", entity.TaxBranchCode);
                command.AddParameter(typeof(decimal), "ServiceCharge", entity.ServiceCharge);
                command.AddParameter(typeof(decimal), "FlagActive", entity.FlagActive);

                string zoneXml = Utils.ConvertUtil.ConvertToXml_Store <Models.ZoneDo>(entity.Zones);
                command.AddParameter(typeof(string), "ZoneXML", zoneXml);

                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);
                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                List <Models.BranchDo> branchs = command.ToList <Models.BranchDo>();
                if (branchs != null)
                {
                    if (branchs.Count > 0)
                    {
                        command.ClearParameters();

                        command.AddParameter(typeof(int), "BranchID", branchs[0].BranchID);

                        command.CommandText = "[dbo].[sp_Get_ZoneList]";
                        branchs[0].Zones    = command.ToList <Models.ZoneDo>();

                        result.Branch = branchs[0];
                    }
                }

                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #8
0
        public Models.UpdateMemberTypeResultDo CreateMemberType(Models.MemberTypeDo entity)
        {
            Models.UpdateMemberTypeResultDo result = new Models.UpdateMemberTypeResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Create_MemberType]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "MemberTypeName", entity.MemberTypeName);
                command.AddParameter(typeof(string), "Remark", entity.Remark);

                command.AddParameter(typeof(decimal), "CreditDiscountValue", entity.CreditDiscountValue);
                command.AddParameter(typeof(string), "CreditDiscountType", entity.CreditDiscountType);

                command.AddParameter(typeof(decimal), "CashDiscountValue", entity.CashDiscountValue);
                command.AddParameter(typeof(string), "CashDiscountType", entity.CashDiscountType);

                command.AddParameter(typeof(int), "MemberLifeType", entity.MemberLifeType);
                command.AddParameter(typeof(DateTime), "StartPeriod", entity.StartPeriod);
                command.AddParameter(typeof(DateTime), "EndPeriod", entity.EndPeriod);
                command.AddParameter(typeof(bool), "FlagActive", entity.FlagActive);
                command.AddParameter(typeof(decimal), "Lifetime", entity.Lifetime);
                command.AddParameter(typeof(decimal), "Price", entity.Price);

                string brandXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MemberTypeBrandDo>(entity.Brands);
                command.AddParameter(typeof(string), "BrandXML", brandXml);

                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);
                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                System.Collections.IList[] dbls = command.ToList(typeof(Models.MemberTypeDo), typeof(Models.MemberTypeBrandDo));
                if (dbls != null)
                {
                    List <Models.MemberTypeDo> dbmts       = dbls[0] as List <Models.MemberTypeDo>;
                    List <Models.MemberTypeBrandDo> dbmtbs = dbls[1] as List <Models.MemberTypeBrandDo>;
                    if (dbmts != null)
                    {
                        if (dbmts.Count > 0)
                        {
                            result.MemberType = dbmts[0];

                            if (dbmtbs != null)
                            {
                                result.MemberType.Brands = dbmtbs;
                            }
                        }
                    }
                }

                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #9
0
        public Models.UpdateDiscountResultDo UpdateDiscount(Models.DiscountDo entity)
        {
            Models.UpdateDiscountResultDo result = new Models.UpdateDiscountResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Update_Discount]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "DiscountID", entity.DiscountID);
                command.AddParameter(typeof(string), "DiscountName", entity.DiscountName);
                command.AddParameter(typeof(string), "Remark", entity.Remark);

                command.AddParameter(typeof(decimal), "CreditDiscountValue", entity.CreditDiscountValue);
                command.AddParameter(typeof(string), "CreditDiscountType", entity.CreditDiscountType);

                command.AddParameter(typeof(decimal), "CashDiscountValue", entity.CashDiscountValue);
                command.AddParameter(typeof(string), "CashDiscountType", entity.CashDiscountType);

                command.AddParameter(typeof(bool), "FlagDiscountAll", entity.FlagDiscountAll);
                command.AddParameter(typeof(DateTime), "ActiveDate", entity.ActiveDate);
                command.AddParameter(typeof(DateTime), "ExpireDate", entity.ExpireDate);
                command.AddParameter(typeof(bool), "FlagActive", entity.FlagActive);

                string brandXml = Utils.ConvertUtil.ConvertToXml_Store <Models.DiscountBrandDo>(entity.Brands);
                command.AddParameter(typeof(string), "BrandXML", brandXml);

                string groupXml = Utils.ConvertUtil.ConvertToXml_Store <Models.DiscountUserGroupDo>(entity.Groups);
                command.AddParameter(typeof(string), "UserGroupXML", groupXml);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                System.Collections.IList[] dbls = command.ToList(
                    typeof(Models.DiscountDo), typeof(Models.DiscountBrandDo), typeof(Models.DiscountUserGroupDo));
                if (dbls != null)
                {
                    List <Models.DiscountDo> dbds           = dbls[0] as List <Models.DiscountDo>;
                    List <Models.DiscountBrandDo> dbdbs     = dbls[1] as List <Models.DiscountBrandDo>;
                    List <Models.DiscountUserGroupDo> dbdus = dbls[2] as List <Models.DiscountUserGroupDo>;
                    if (dbds != null)
                    {
                        if (dbds.Count > 0)
                        {
                            result.Discount        = dbds[0];
                            result.Discount.Brands = dbdbs;
                            result.Discount.Groups = dbdus;
                        }
                    }
                }
                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #10
0
        public Models.UserGroupResultDo UpdateUserGroup(Models.UserGroupDo entity)
        {
            Models.UserGroupResultDo result = new Models.UserGroupResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Update_UserGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", entity.GroupID);
                command.AddParameter(typeof(string), "NameEN", entity.NameEN);
                command.AddParameter(typeof(string), "NameLC", entity.NameLC);
                command.AddParameter(typeof(string), "Description", entity.Description);
                command.AddParameter(typeof(decimal), "CashDiscount", entity.CashDiscount);
                command.AddParameter(typeof(decimal), "CreditDiscount", entity.CreditDiscount);
                command.AddParameter(typeof(bool), "FlagActive", entity.FlagActive);

                string userXML = Utils.ConvertUtil.ConvertToXml_Store <Models.UserInGroupDo>(entity.Users);
                command.AddParameter(typeof(string), "UserInGroupXML", userXML);

                string permissionXML = Utils.ConvertUtil.ConvertToXml_Store <Models.UserGroupPermissionDo>(entity.Permissions);
                command.AddParameter(typeof(string), "GroupPermissionXML", permissionXML);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                List <Models.UserGroupDo> list = command.ToList <Models.UserGroupDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result.Group = list[0];
                    }
                }
                result.ErrorParameter(error);
            }));
            if (result.Group != null)
            {
                result.Permissions = this.GetUserGroupPermission(new Common.DataSvc.Models.UserGroupCriteriaDo()
                {
                    GroupID = result.Group.GroupID
                });
            }

            return(result);
        }
Beispiel #11
0
        public Models.UpdateMenuResultDo CreateMenu(Models.MenuDo entity)
        {
            Models.UpdateMenuResultDo result = new Models.UpdateMenuResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Create_Menu]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", entity.GroupID);
                command.AddParameter(typeof(int), "CategoryID", entity.CategoryID);
                command.AddParameter(typeof(int), "SubCategoryID", entity.SubCategoryID);
                command.AddParameter(typeof(string), "Code", entity.Code);
                command.AddParameter(typeof(string), "Name", entity.Name);
                command.AddParameter(typeof(string), "NickName", entity.NickName);
                command.AddParameter(typeof(decimal), "Price", entity.Price);
                command.AddParameter(typeof(string), "Printer", entity.Printer);
                command.AddParameter(typeof(bool), "FlagTakeAway", entity.FlagTakeAway);
                command.AddParameter(typeof(bool), "FlagAllowDiscount", entity.FlagAllowDiscount);
                command.AddParameter(typeof(bool), "FlagSpecifyPrice", entity.FlagSpecifyPrice);
                command.AddParameter(typeof(string), "SeparateBill", entity.SeparateBill);
                command.AddParameter(typeof(string), "BillHeader", entity.BillHeader);
                command.AddParameter(typeof(string), "MenuType", entity.MenuType);

                string brandXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MenuBrandDo>(entity.Brands);
                command.AddParameter(typeof(string), "MenuBrandXML", brandXml);

                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);
                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                List <Models.MenuDo> list = command.ToList <Models.MenuDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result.Menu = list[0];
                    }
                }

                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #12
0
        public Models.MemberImportSuccessResultDo GetMemberImportSuccess(Models.MemberImportCriteriaDo criteria)
        {
            Models.MemberImportSuccessResultDo result = new Models.MemberImportSuccessResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_MemberImportSuccess]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "ImportTransactionID", criteria.ImportTransactionID);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.MemberImportSuccessDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #13
0
        public Models.TemplateResultDo GetTemplateList(Models.TemplateCriteriaDo criteria)
        {
            Models.TemplateResultDo result = new Models.TemplateResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Get_TemplateList]";

                command.AddParameter(typeof(string), "TemplateName", criteria.TemplateName);
                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.TemplateDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #14
0
        public Models.DiscountResultDo GetDiscountList(Models.DiscountCriteriaDo criteria)
        {
            Models.DiscountResultDo result = new Models.DiscountResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_DiscountList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "DiscountName", criteria.DiscountName);
                command.AddParameter(typeof(decimal), "DiscountValue", criteria.DiscountValue);
                command.AddParameter(typeof(string), "DiscountType", criteria.DiscountType);
                command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.DiscountFSDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #15
0
        public Models.UserFSResultDo GetUserList(Models.UserCriteriaDo criteria)
        {
            Models.UserFSResultDo result = new Models.UserFSResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_UserList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "UserName", criteria.UserName);
                command.AddParameter(typeof(int), "GroupID", criteria.GroupID);
                command.AddParameter(typeof(bool), "FlagActive", criteria.FlagActive);
                command.AddParameter(typeof(bool), "IncludeSystemAdmin", criteria.IncludeSystemAdmin);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria);

                result.Rows = command.ToList <Models.UserFSDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #16
0
        public Models.VoucherResultDo GetVoucherList(Models.VoucherCriteriaDo criteria)
        {
            Models.VoucherResultDo result = new Models.VoucherResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_VoucherList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "VoucherTemplateID", criteria.VoucherTemplateID);
                command.AddParameter(typeof(string), "VoucherNumber", criteria.VoucherNumber);
                command.AddParameter(typeof(decimal), "VoucherValue", criteria.VoucherValue);
                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(DateTime), "CreateDateFrom", criteria.CreateDateFrom);
                command.AddParameter(typeof(DateTime), "CreateDateTo", criteria.CreateDateTo);
                command.AddParameter(typeof(DateTime), "StartDate", criteria.StartDate);
                command.AddParameter(typeof(DateTime), "EndDate", criteria.EndDate);
                command.AddParameter(typeof(DateTime), "PrintDateFrom", criteria.PrintDateFrom);
                command.AddParameter(typeof(DateTime), "PrintDateTo", criteria.PrintDateTo);
                command.AddParameter(typeof(DateTime), "UsedDateFrom", criteria.UsedDateFrom);
                command.AddParameter(typeof(DateTime), "UsedDateTo", criteria.UsedDateTo);
                command.AddParameter(typeof(bool), "IsUsed", criteria.IsUsed);
                command.AddParameter(typeof(bool), "IsExpired", criteria.IsExpired);
                command.AddParameter(typeof(bool), "IsVoid", criteria.IsVoid);
                command.AddParameter(typeof(bool), "IsActive", criteria.IsActive);
                command.AddParameter(typeof(DateTime), "CurrentDate", criteria.CurrentDate);

                Utils.SQL.ISQLDbParameter output        = command.AddSearchParameter(criteria);
                Utils.SQL.ISQLDbParameter ovoucher      = command.AddOutputParameter(typeof(int), "TotalVoucher");
                Utils.SQL.ISQLDbParameter ovouchervalue = command.AddOutputParameter(typeof(int), "TotalVoucherValue");

                result.Rows = command.ToList <Models.VoucherFSDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #17
0
        public Models.UpdateMenuGroupResultDo UpdateMenuGroup(Models.UpdateMenuGroupDo entity)
        {
            Models.UpdateMenuGroupResultDo result = new Models.UpdateMenuGroupResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Update_MenuGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                string groupXml = Utils.ConvertUtil.ConvertToXml_Store <Models.MenuGroupDo>(entity.Groups);
                command.AddParameter(typeof(string), "MenuGroupXML", groupXml);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                command.ExecuteNonQuery();
                result.ErrorParameter(error);
            }));

            return(result);
        }
Beispiel #18
0
        public Models.CustomerForOrderTaxResultDo GetCustomerForOrderTax(Models.CustomerForOrderTaxCriteriaDo criteria)
        {
            Models.CustomerForOrderTaxResultDo result = new Models.CustomerForOrderTaxResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_FE_Get_CustomerForOrderTax]";

                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);

                command.AddParameter(typeof(string), "CustomerName", criteria.CustomerName);
                command.AddParameter(typeof(string), "CustomerTaxID", criteria.CustomerTaxID);
                command.AddParameter(typeof(string), "CustomerBranchCode", criteria.CustomerBranchCode);
                command.AddParameter(typeof(string), "TelNo", criteria.TelNo);

                Utils.SQL.ISQLDbParameter output = command.AddSearchParameter(criteria, sorting: false, isAssending: false);

                result.Rows = command.ToList <Models.CustomerForOrderTaxDo>();
                result.TotalRecordParameter(output);
            }));

            return(result);
        }
Beispiel #19
0
        public Models.VoucherResultDo GetVoucherTemplateList(Models.VoucherCriteriaDo criteria)
        {
            Models.VoucherResultDo result = new Models.VoucherResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Get_VoucherTemplateList]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "VoucherName", criteria.VoucherName);
                command.AddParameter(typeof(string), "VoucherNumber", criteria.VoucherNumber);
                command.AddParameter(typeof(decimal), "VoucherValue", criteria.VoucherValue);
                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(int), "BranchID", criteria.BranchID);
                command.AddParameter(typeof(DateTime), "CreateDateFrom", criteria.CreateDateFrom);
                command.AddParameter(typeof(DateTime), "CreateDateTo", criteria.CreateDateTo);
                command.AddParameter(typeof(DateTime), "StartDate", criteria.StartDate);
                command.AddParameter(typeof(DateTime), "EndDate", criteria.EndDate);
                command.AddParameter(typeof(DateTime), "PrintDateFrom", criteria.PrintDateFrom);
                command.AddParameter(typeof(DateTime), "PrintDateTo", criteria.PrintDateTo);
                command.AddParameter(typeof(DateTime), "UsedDateFrom", criteria.UsedDateFrom);
                command.AddParameter(typeof(DateTime), "UsedDateTo", criteria.UsedDateTo);
                command.AddParameter(typeof(bool), "IsUsed", criteria.IsUsed);
                command.AddParameter(typeof(bool), "IsExpired", criteria.IsExpired);
                command.AddParameter(typeof(bool), "IsVoid", criteria.IsVoid);
                command.AddParameter(typeof(bool), "IsActive", criteria.IsActive);
                command.AddParameter(typeof(DateTime), "CurrentDate", criteria.CurrentDate);

                Utils.SQL.ISQLDbParameter output         = command.AddSearchParameter(criteria);
                Utils.SQL.ISQLDbParameter tvoucher       = command.AddOutputParameter(typeof(int), "TotalVoucher");
                Utils.SQL.ISQLDbParameter tvouchervalue  = command.AddOutputParameter(typeof(int), "TotalVoucherValue");
                Utils.SQL.ISQLDbParameter tfvoucher      = command.AddOutputParameter(typeof(int), "TotalFilterVoucher");
                Utils.SQL.ISQLDbParameter tfvouchervalue = command.AddOutputParameter(typeof(int), "TotalFilterVoucherValue");

                System.Collections.IList[] dbls = command.ToList(typeof(Models.VoucherFSDo), typeof(Models.VoucherBrandDo), typeof(Models.VoucherBranchDo));
                if (dbls != null)
                {
                    List <Models.VoucherFSDo> voucher           = dbls[0] as List <Models.VoucherFSDo>;
                    List <Models.VoucherBrandDo> voucherbrand   = dbls[1] as List <Models.VoucherBrandDo>;
                    List <Models.VoucherBranchDo> voucherbranch = dbls[2] as List <Models.VoucherBranchDo>;
                    if (voucher != null)
                    {
                        result.Rows = voucher;

                        if (voucherbrand != null)
                        {
                            foreach (Models.VoucherFSDo v in result.Rows)
                            {
                                v.Brands = voucherbrand.FindAll(x => x.VoucherTemplateID == v.VoucherTemplateID);
                            }
                        }

                        if (voucherbranch != null)
                        {
                            foreach (Models.VoucherFSDo v in result.Rows)
                            {
                                v.Branches = voucherbranch.FindAll(x => x.VoucherTemplateID == v.VoucherTemplateID);
                            }
                        }
                        if (tvoucher != null)
                        {
                            result.TotalVoucher = (int)tvoucher.Value;
                        }
                        if (tvouchervalue != null)
                        {
                            result.TotalVoucherValue = (int)tvouchervalue.Value;
                        }
                        if (tfvoucher != null)
                        {
                            result.TotalFilterVoucher = (int)tfvoucher.Value;
                        }
                        if (tfvouchervalue != null)
                        {
                            result.TotalFilterVoucherValue = (int)tfvouchervalue.Value;
                        }

                        result.TotalRecordParameter(output);
                    }
                }
            }));

            return(result);
        }