public DataSet dal_JobCreationDetail(bel_JobCreation obj_bel_Job) { DataSet ds = new DataSet(); try { SqlCommand sqlcmd = new SqlCommand("spu_JOBCreation"); sqlcmd.CommandTimeout = 0; sqlcmd.CommandType = CommandType.StoredProcedure; sqlcmd.Parameters.Clear(); sqlcmd.Parameters.AddWithValue("@JOBID", obj_bel_Job._JOBID); sqlcmd.Parameters.AddWithValue("@JOBCode", obj_bel_Job._JOBCode); sqlcmd.Parameters.AddWithValue("@CustomerID", obj_bel_Job._CustomerID); sqlcmd.Parameters.AddWithValue("@Remarks", obj_bel_Job._Remarks); sqlcmd.Parameters.AddWithValue("@CancelReason", obj_bel_Job._CancelReason); sqlcmd.Parameters.AddWithValue("@JOBStatus", obj_bel_Job._JOBStatus); sqlcmd.Parameters.AddWithValue("@GeneralOrderStatus", obj_bel_Job._GeneralOrderStatus); sqlcmd.Parameters.AddWithValue("@CreatedBy", Convert.ToInt32(HttpContext.Current.Session["UserID"])); sqlcmd.Parameters.AddWithValue("@CreatedOn", obj_bel_Job._CreatedOn); sqlcmd.Parameters.AddWithValue("@ModifiedBy", Convert.ToInt32(HttpContext.Current.Session["UserID"])); sqlcmd.Parameters.AddWithValue("@ModifiedOn", obj_bel_Job._ModifiedOn); sqlcmd.Parameters.AddWithValue("@BillFromDate", obj_bel_Job._BillFromDate); sqlcmd.Parameters.AddWithValue("@BillToDate", obj_bel_Job._BillToDate); sqlcmd.Parameters.AddWithValue("@BillNumber", obj_bel_Job._BillNumber); sqlcmd.Parameters.AddWithValue("@CompanyID", Convert.ToInt32(HttpContext.Current.Session["CompanyID"])); sqlcmd.Parameters.AddWithValue("@iMode", obj_bel_Job._iMode); sqlcmd.Parameters.AddWithValue("@Year", Convert.ToInt32(HttpContext.Current.Session["FinancialYear"])); sqlcmd.Parameters.AddWithValue("@BranchID", Convert.ToInt32(HttpContext.Current.Session["BranchID"])); ds = DataFunctions.GetDataSet(sqlcmd); } catch (Exception ex) { } return ds; }
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; } }
//selected item will sow the corresponding text box void functionfetcdata(bel_JobCreation obj_bel_Job) { try { obj_bel_Job._iMode = "Fetch"; using (DataSet ds = obj_dal_Job.dal_JobCreationDetail(obj_bel_Job)) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["JOBID"] != null) { hfldid.Value = ds.Tables[0].Rows[0]["JOBID"].ToString(); } if (ds.Tables[0].Rows[0]["JOBCode"] != null) { txtJobNo.Text = ds.Tables[0].Rows[0]["JOBCode"].ToString(); } if (ds.Tables[0].Rows[0]["PartyID"] != null) { DropCustomer.SelectedValue = ds.Tables[0].Rows[0]["PartyID"].ToString(); } if (ds.Tables[0].Rows[0]["Remarks"] != null) { txtRemarks.Text = ds.Tables[0].Rows[0]["Remarks"].ToString(); } if (ds.Tables[0].Rows[0]["GeneralOrderStatus"] != null) { rblGeneralOrder.SelectedValue = ds.Tables[0].Rows[0]["GeneralOrderStatus"].ToString(); } if (ds.Tables[0].Rows[0]["JOBStatus"] != null) { rblDesignStatus.SelectedValue = ds.Tables[0].Rows[0]["JOBStatus"].ToString(); if (rblDesignStatus.SelectedValue == "C") { tblCancel.Visible = true; } else { tblCancel.Visible = false; } if (ds.Tables[0].Rows[0]["CancelReason"] != null) { txtcancelReason.Text = ds.Tables[0].Rows[0]["CancelReason"].ToString(); } } } } } } catch (Exception ex) { obj_Common.LogFile(ex.Message, "Job-Creation:functionfetcdata", Convert.ToInt32(ex.StackTrace.Substring(ex.StackTrace.LastIndexOf(":line") + 5)), this.Page.ToString()); } }