Пример #1
0
        public DataSet dal_AutoGenBranch(bel_Branch obj_bel_Branch)
        {
            DataSet ds = new DataSet();
            try
            {

                SqlCommand sqlcmd = new SqlCommand("spu_AutoGenMaster");
                sqlcmd.CommandTimeout = 0;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.Clear();
                sqlcmd.Parameters.AddWithValue("@screenName", obj_bel_Branch._ScreenName);

                ds = DataFunctions.GetDataSet(sqlcmd);
            }
            catch (Exception ex)
            {

            }
            return ds;
        }
Пример #2
0
        public DataSet dal_Branchdetail(bel_Branch obj_bel_Branch)
        {
            DataSet ds = new DataSet();
            try
            {
                SqlCommand sqlcmd = new SqlCommand("spu_Branch");
                sqlcmd.CommandTimeout = 0;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.Clear();
                sqlcmd.Parameters.AddWithValue("@iMode", obj_bel_Branch._iMode);
                sqlcmd.Parameters.AddWithValue("@BranchID", obj_bel_Branch._BranchID);
                sqlcmd.Parameters.AddWithValue("@BranchCode", obj_bel_Branch._BranchCode);
                sqlcmd.Parameters.AddWithValue("@BranchName", obj_bel_Branch._BranchName);
                sqlcmd.Parameters.AddWithValue("@Address1", obj_bel_Branch._Address1);
                sqlcmd.Parameters.AddWithValue("@Address2", obj_bel_Branch._Address2);
                sqlcmd.Parameters.AddWithValue("@Address3", obj_bel_Branch._Address3);
                sqlcmd.Parameters.AddWithValue("@City", obj_bel_Branch._City);
                sqlcmd.Parameters.AddWithValue("@State", obj_bel_Branch._State);
                sqlcmd.Parameters.AddWithValue("@Country", obj_bel_Branch._Country);
                sqlcmd.Parameters.AddWithValue("@PostalCode", obj_bel_Branch._PostalCode);
                sqlcmd.Parameters.AddWithValue("@PhoneNumber", obj_bel_Branch._PhoneNumber);
                sqlcmd.Parameters.AddWithValue("@Email", obj_bel_Branch._Email);
                sqlcmd.Parameters.AddWithValue("@ContactPerson", obj_bel_Branch._ContactPerson);
                sqlcmd.Parameters.AddWithValue("@BranchStatus", obj_bel_Branch._BranchStatus);
                sqlcmd.Parameters.AddWithValue("@CreatedBy", obj_bel_Branch._CreatedBy);
                sqlcmd.Parameters.AddWithValue("@CreatedOn", obj_bel_Branch._CreatedOn);
                sqlcmd.Parameters.AddWithValue("@ModifiedBy", obj_bel_Branch._ModifiedBy);
                sqlcmd.Parameters.AddWithValue("@ModifiedOn", obj_bel_Branch._ModifiedOn);
                sqlcmd.Parameters.AddWithValue("@ScreenName", obj_bel_Branch._ScreenName);
                sqlcmd.Parameters.AddWithValue("@CompanyID", Convert.ToInt32(HttpContext.Current.Session["CompanyID"]));

                ds = DataFunctions.GetDataSet(sqlcmd);
            }
            catch (Exception es)
            {

            }
            return ds;
        }
Пример #3
0
        public static List<Dictionary<string, object>> search_(string page_name, string imode)
        {
            DataSet ds = new DataSet();
            List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
            Dictionary<string, object> row = new Dictionary<string, object>();
            try
            {
                switch (page_name)
                {

                    case "CATEGORY":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Category obj_bel_Category = new bel_Category();
                            dal_Category obj_dal_Category = new dal_Category();
                            obj_bel_Category._iMode = imode;
                            using (ds = obj_dal_Category.dal_CategoryDetail(obj_bel_Category))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "CURRENCY":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Currency obj_bel_Currency = new bel_Currency();
                            dal_Currency obj_dal_Currency = new dal_Currency();
                            obj_bel_Currency._iMode = imode;
                            using (ds = obj_dal_Currency.dal_CurrencyDetail(obj_bel_Currency))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "PRODUCTGROUP":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_ProductGroup obj_bel_ProductGroup = new bel_ProductGroup();
                            dal_ProductGroup obj_dal_ProductGroup = new dal_ProductGroup();
                            obj_bel_ProductGroup._iMode = imode;
                            using (ds = obj_dal_ProductGroup.dal_ProductGroupDetail(obj_bel_ProductGroup))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "UOM":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_UOM obj_bel_UOM = new bel_UOM();
                            dal_UOM obj_dal_UOM = new dal_UOM();
                            obj_bel_UOM._iMode = imode;
                            using (ds = obj_dal_UOM.dal_UOMDetail(obj_bel_UOM))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "TAX":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Tax obj_bel_Tax = new bel_Tax();
                            dal_Tax obj_dal_Tax = new dal_Tax();
                            obj_bel_Tax._iMode = imode;
                            using (ds = obj_dal_Tax.dal_TAXDetail(obj_bel_Tax))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "Discount":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Discount obj_bel_Discount = new bel_Discount();
                            dal_Discount obj_dal_Discount = new dal_Discount();
                            obj_bel_Discount._iMode = imode;
                            using (ds = obj_dal_Discount.dal_DiscountDetail(obj_bel_Discount))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "BRANCH":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Branch obj_bel_Branch = new bel_Branch();
                            dal_Branch obj_dal_Branch = new dal_Branch();
                            obj_bel_Branch._iMode = imode;
                            using (ds = obj_dal_Branch.dal_Branchdetail(obj_bel_Branch))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "WAREHOUSE":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Warehouse obj_bel_Warehouse = new bel_Warehouse();
                            dal_Warehouse obj_dal_Warehouse = new dal_Warehouse();
                            obj_bel_Warehouse._iMode = imode;
                            using (ds = obj_dal_Warehouse.dal_WarehouseDetail(obj_bel_Warehouse))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;

                    case "CUSTOMER":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Customer obj_bel_Customer = new bel_Customer();
                            dal_Customer obj_dal_Customer = new dal_Customer();
                            obj_bel_Customer._iMode = imode;
                            using (ds = obj_dal_Customer.dal_Customerdetail(obj_bel_Customer))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "PRODUCT":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Product obj_bel_Product = new bel_Product();
                            dal_Product obj_dal_Product = new dal_Product();
                            obj_bel_Product._iMode = imode;
                            using (ds = obj_dal_Product.dal_ProductDetail(obj_bel_Product))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "TASK":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_Task obj_bel_Task = new bel_Task();
                            dal_Task obj_dal_Task = new dal_Task();
                            obj_bel_Task._iMode = imode;
                            using (ds = obj_dal_Task.dal_TaskDetail(obj_bel_Task))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;

                    case "JOB":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_JobCreation obj_bel_Job = new bel_JobCreation();
                            dal_JobCreation obj_dal_Job = new dal_JobCreation();
                            obj_bel_Job._iMode = imode;
                            using (ds = obj_dal_Job.dal_JobCreationDetail(obj_bel_Job))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "SUBTYPE":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_SubType obj_bel_SubType = new bel_SubType();
                            dal_SubType obj_dal_SubType = new dal_SubType();
                            obj_bel_SubType._iMode = imode;
                            using (ds = obj_dal_SubType.dal_SubTypeDetail(obj_bel_SubType))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "CHARTOFACCOUNTS":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_ChartOfAccounts obj_bel_ChartOfAccounts = new bel_ChartOfAccounts();
                            dal_ChartOfAccounts obj_dal_ChartOfAccounts = new dal_ChartOfAccounts();
                            obj_bel_ChartOfAccounts._iMode = imode;
                            using (ds = obj_dal_ChartOfAccounts.dal_ChartOfAccountsDetail(obj_bel_ChartOfAccounts))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "USERCREATION":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {
                            bel_UserCreation obj = new bel_UserCreation();
                            dal_UserCreation dal = new dal_UserCreation();
                            obj._iMode = imode;
                            using (ds = dal.dal_UserCreationdetail(obj))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "SHIPPINGADDRESS":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {

                            bel_ShippingAddress obj_bel_shipping = new bel_ShippingAddress();
                            dal_ShippingAddress obj_dal_shipping = new dal_ShippingAddress();
                            obj_bel_shipping._iMode = imode;
                            using (ds = obj_dal_shipping.dal_ShippingDetail(obj_bel_shipping))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;

                    case "COMPANY":
                        if (imode == "SEARCH" || imode == "DELETE")
                        {

                            bel_Company obj_bel_Company = new bel_Company();
                            dal_Company obj_dal_Company = new dal_Company();
                            obj_bel_Company._iMode = imode;
                            using (ds = obj_dal_Company.dal_Companydetail(obj_bel_Company))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;

                }
                row.Add("res", "No Data");
                rows.Add(row);
                return rows;
            }
            catch (Exception ex)
            {
                row.Add("res", "exception");
                rows.Add(row);
                return rows;
            }
        }