public static List<Dictionary<string, object>> Load_users(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 { bel_UserCreation obj_bel_UserCreation = new bel_UserCreation(); dal_UserCreation obj_dal_UserCreation = new dal_UserCreation(); obj_bel_UserCreation._iMode = imode; using (ds = obj_dal_UserCreation.dal_UserCreationdetail(obj_bel_UserCreation)) { if (ds.Tables.Count > 0) { return Json.getjson_(ds.Tables[0]); } else { row.Add("res", "No Data"); rows.Add(row); return rows; } } } catch (Exception ex) { row.Add("res", "exception"); rows.Add(row); return rows; } }
public DataSet dal_UserCreationdetail(bel_UserCreation obj_bel_UserCreation) { DataSet ds = new DataSet(); try { SqlCommand sqlcmd = new SqlCommand("spu_UserCreation"); sqlcmd.CommandTimeout = 0; sqlcmd.CommandType = CommandType.StoredProcedure; sqlcmd.Parameters.Clear(); sqlcmd.Parameters.AddWithValue("@iMode", obj_bel_UserCreation._iMode); sqlcmd.Parameters.AddWithValue("@UserID", obj_bel_UserCreation._UserID); sqlcmd.Parameters.AddWithValue("@UserName", obj_bel_UserCreation._UserName); sqlcmd.Parameters.AddWithValue("@Password", obj_bel_UserCreation._Password); sqlcmd.Parameters.AddWithValue("@UserGroupID", obj_bel_UserCreation._UserGroupID); sqlcmd.Parameters.AddWithValue("@Email", obj_bel_UserCreation._Email); sqlcmd.Parameters.AddWithValue("@UserStatus", obj_bel_UserCreation._UserStatus); sqlcmd.Parameters.AddWithValue("@AdminStatus", obj_bel_UserCreation._AdminStatus); sqlcmd.Parameters.AddWithValue("@SuperAdminStatus", obj_bel_UserCreation._SuperAdminStatus); sqlcmd.Parameters.AddWithValue("@CreatedBy", Convert.ToInt32(HttpContext.Current.Session["UserID"])); sqlcmd.Parameters.AddWithValue("@CreatedOn", obj_bel_UserCreation._CreatedOn); sqlcmd.Parameters.AddWithValue("@ModifiedBy", Convert.ToInt32(HttpContext.Current.Session["UserID"])); sqlcmd.Parameters.AddWithValue("@ModifiedOn", obj_bel_UserCreation._ModifiedOn); sqlcmd.Parameters.AddWithValue("@ScreenName", obj_bel_UserCreation._ScreenName); sqlcmd.Parameters.AddWithValue("@CompanyID", Convert.ToInt32(HttpContext.Current.Session["CompanyID"])); sqlcmd.Parameters.AddWithValue("@BranchID", Convert.ToInt32(HttpContext.Current.Session["BranchID"])); ds = DataFunctions.GetDataSet(sqlcmd); } catch (Exception es) { } 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_UserCreation obj_bel_UserCreation) { try { obj_bel_UserCreation._iMode = "Fetch"; using (DataSet ds = obj_dal_UserCreation.dal_UserCreationdetail(obj_bel_UserCreation)) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["UserID"] != null) { hfldid.Value = ds.Tables[0].Rows[0]["UserID"].ToString(); } if (ds.Tables[0].Rows[0]["LoginID"] != null) { txtusername.Text = ds.Tables[0].Rows[0]["LoginID"].ToString(); } if (ds.Tables[0].Rows[0]["LoginPassword"] != null) { txtPassword.Attributes.Add("value", Obj_ComEncript.fDecrypt(ds.Tables[0].Rows[0]["LoginPassword"].ToString())); txtretypepassword.Attributes.Add("value", Obj_ComEncript.fDecrypt(ds.Tables[0].Rows[0]["LoginPassword"].ToString())); } if (ds.Tables[0].Rows[0]["UserGroupID"] != null) { dropusergroup.SelectedValue = ds.Tables[0].Rows[0]["UserGroupID"].ToString(); } if (ds.Tables[0].Rows[0]["Email"] != null) { txtEmail.Text = ds.Tables[0].Rows[0]["Email"].ToString(); } if (ds.Tables[0].Rows[0]["IsAdmin"] != null) { rblIsAdmin.SelectedValue = ds.Tables[0].Rows[0]["IsAdmin"].ToString(); } if (ds.Tables[0].Rows[0]["IsSuperAdmin"] != null) { rblIsSuperAdmin.SelectedValue = ds.Tables[0].Rows[0]["IsSuperAdmin"].ToString(); } if (ds.Tables[0].Rows[0]["UserLoginStatus"] != null) { rbluserstatus.SelectedValue = ds.Tables[0].Rows[0]["UserLoginStatus"].ToString(); } } } } txtusername.Focus(); } catch (Exception es) { } }