예제 #1
0
        public DataSet dal_TaskDetail(bel_Task obj_bel_Task)
        {
            DataSet ds = new DataSet();
            try
            {

                SqlCommand sqlcmd = new SqlCommand("spu_TaskListSearch");
                sqlcmd.CommandTimeout = 0;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.Clear();
                sqlcmd.Parameters.AddWithValue("@TaskListID", obj_bel_Task._TaskListID);
                sqlcmd.Parameters.AddWithValue("@TaskListDetailID", obj_bel_Task._TaskListDetailID);
                sqlcmd.Parameters.AddWithValue("@UserGroupID", obj_bel_Task._UserGroupID);
                sqlcmd.Parameters.AddWithValue("@UserID", obj_bel_Task._UserID);
                sqlcmd.Parameters.AddWithValue("@JobID", Convert.ToInt32(HttpContext.Current.Session["UserID"]));
                sqlcmd.Parameters.AddWithValue("@CompanyID", Convert.ToInt32(HttpContext.Current.Session["CompanyID"]));
                sqlcmd.Parameters.AddWithValue("@BranchID", Convert.ToInt32(HttpContext.Current.Session["BranchID"]));
                sqlcmd.Parameters.AddWithValue("@iMode", obj_bel_Task._iMode);
                sqlcmd.Parameters.AddWithValue("@ScreenName", obj_bel_Task._ScreenName);

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

            }
            return ds;
        }
예제 #2
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;
            }
        }