Beispiel #1
0
        public static List<Data> GetData()
        {
            List<Data> DataList = new List<Data>();
            bel_Product bel = new bel_Product();
            dal_Product dal = new dal_Product();
            bel._iMode = "Search";
            DataSet ds = new DataSet();
            ds = dal.dal_ProductDetail(bel);
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                Data thisData2 = new Data();
                thisData2.SNo = row["SNo"].ToString();
                thisData2.ProductCode = row["ProductCode"].ToString();
                thisData2.Description = row["Description"].ToString();

                DataList.Add(thisData2);
            }

            //Data thisData = new Data();
            //thisData.SNo = "2";
            //thisData.ProductCode = "Hawk";
            //thisData.Description = "Aries";

            //DataList.Add(thisData);

            return DataList;
        }
Beispiel #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;
            }
        }
Beispiel #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 "PURCHASEORDER":
                        if (imode == "PRINT")
                        {
                            bel_PurchaseOrder obj_bel_PurchaseOrder = new bel_PurchaseOrder();
                            dal_PurchaseOrder obj_dal_PurchaseOrder = new dal_PurchaseOrder();
                            obj_bel_PurchaseOrder._iMode = imode;
                            using (ds = obj_dal_PurchaseOrder.dal_PurchaseOrderDetail(obj_bel_PurchaseOrder))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "QUOTATION":
                        if (imode == "PRINT")
                        {
                            bel_Quotation obj_bel_Proforma = new bel_Quotation();
                            dal_Quotation obj_dal_Proforma = new dal_Quotation();
                            obj_bel_Proforma._iMode = imode;
                            using (ds = obj_dal_Proforma.dal_ProformaDetail(obj_bel_Proforma))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "SALESORDER":
                        if (imode == "PRINT")
                        {
                            bel_Salesorder obj_bel_DC = new bel_Salesorder();
                            dal_Salesorder obj_dal_DC = new dal_Salesorder();
                            obj_bel_DC._iMode = imode;
                            using (ds = obj_dal_DC.dal_DCDetail(obj_bel_DC))
                            {
                                return Json.getjson_(ds.Tables[0]);
                            }
                        }
                        break;
                    case "PRODUCT":
                        if (imode == "PRINT")
                        {
                            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;

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