Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Test in C

private void LoadEmployeeList()
{
MRMS.DAL.Common.GridSettingscls gridsetting = new MRMS.DAL.Common.GridSettingscls();
EmployeeDataAccessComponent empDac = new EmployeeDataAccessComponent();
Dictionary<string, string> dict = new Dictionary<string, string>();
for (int _i = 0; _i < Request.QueryString.Keys.Count; _i++)
{
try
{
dict.Add(Request.QueryString.Keys[_i], Request.QueryString[_i]);
if (Request.QueryString.Keys[_i].ToString() == "HRSAStatusCombo")
{
EmpListStatus = Request.QueryString[_i].ToString();
}
}
catch { }
}
int iUserIID = -1;
if (Session["UserInfo"] != null)
{
clsLoginUser LoginUser = (clsLoginUser)Session["UserInfo"];
iUserIID = LoginUser.UserID;
}
object managerKey = iUserIID;

DataTable dtEmpList = null;
Dictionary<string, string[,]> colsetting = new Dictionary<string, string[,]>();
List<JQGridColumn> ColLst = GetEmployeeListColumnList();
MRMS.DAL.Common.GridSettingscls gridSettingDal = new MRMS.DAL.Common.GridSettingscls();
MRMS.Entities.Common.JQGridProcess JQGridProcess = null;
colsetting = gridSettingDal.GetGridviewSettingsCol(dict.ContainsKey("GridSettingName") ? dict["GridSettingName"] : "", iUserIID);

if (EmpListStatus != "0")
{
dtEmpList = empDac.RetrieveAll(managerKey, Convert.ToInt32(EmpListStatus)).ToDataTable();
}
else
{
dtEmpList = empDac.RetrieveAll(managerKey).ToDataTable();
}
Regex r = new Regex(@"\d+", RegexOptions.None);
if (dtEmpList != null && dtEmpList.Rows.Count > 0)
{
foreach (DataRow dr in dtEmpList.Rows)
{
try
{
dr["SocialSecurityNumber"] = Regex.Replace(dr["SocialSecurityNumber"].ToString(), "[0-9]", "*");
}
catch { dr["SocialSecurityNumber"] = "*********"; }
}
}
//dtEmpList = empDac.RetrieveAll(managerKey, 12).ToDataTable();

StringBuilder sb = new StringBuilder();

List<Dictionary<string, string>> ColumsModelss = new List<Dictionary<string, string>>();

JQGridProcess = new MRMS.Entities.Common.JQGridProcess(dtEmpList, ColLst, dict.ContainsKey("GridSettingName") ? dict["GridSettingName"] : "", colsetting, dict);
JQGridProcess.DoPaging = true;
string resp = JQGridProcess.CustomizeDataGrid();
//Response.ContentType = "application/json";
//Response.ContentEncoding = Encoding.UTF8;
Response.Write(resp.ToString());
try { Response.End(); }
catch { }
//string mystring = JQGridProcess.GetColumnModelFromDataTable();
}