public void SaveRoleDetail(RoleDetail argRoleDetail, DataAccess da, List <ErrorHandler> lstErr) { try { if (blnIsRoleDetailExists(argRoleDetail.RoleCode, argRoleDetail.AuthJobRoleCode, argRoleDetail.AuthOrgCode, argRoleDetail.ClientCode, da) == false) { InsertRoleDetail(argRoleDetail, da, lstErr); } else { UpdateRoleDetail(argRoleDetail, da, lstErr); } } catch (Exception ex) { objErrorHandler.Type = ErrorConstant.strAboartType; objErrorHandler.MsgId = 0; objErrorHandler.Module = ErrorConstant.strInsertModule; objErrorHandler.ModulePart = ErrorConstant.strMasterModule; objErrorHandler.Message = ex.Message.ToString(); objErrorHandler.RowNo = 0; objErrorHandler.FieldName = ""; objErrorHandler.LogCode = ""; lstErr.Add(objErrorHandler); } }
private RoleDetail objCreateRoleDetail(DataRow dr) { RoleDetail tRoleDetail = new RoleDetail(); tRoleDetail.SetObjectInfo(dr); return(tRoleDetail); }
public RoleDetail objGetRoleDetail(string argRoleCode, string argAuthJobRoleCode, string argAuthOrgcode, string argClientCode) { RoleDetail argRoleDetail = new RoleDetail(); DataSet DataSetToFill = new DataSet(); if (argRoleCode.Trim() == "") { goto ErrorHandlers; } if (argAuthJobRoleCode.Trim() == "") { goto ErrorHandlers; } if (argAuthOrgcode.Trim() == "") { goto ErrorHandlers; } if (argClientCode.Trim() == "") { goto ErrorHandlers; } DataSetToFill = this.GetRoleDetail(argRoleCode, argAuthJobRoleCode, argAuthOrgcode, argClientCode); if (DataSetToFill.Tables[0].Rows.Count <= 0) { goto Finish; } argRoleDetail = this.objCreateRoleDetail((DataRow)DataSetToFill.Tables[0].Rows[0]); goto Finish; ErrorHandlers: Finish: DataSetToFill = null; return(argRoleDetail); }
public string UpdateRoleDetail(RoleDetail argRoleDetail, DataAccess da, List <ErrorHandler> lstErr) { SqlParameter[] param = new SqlParameter[7]; param[0] = new SqlParameter("@RoleCode", argRoleDetail.RoleCode); param[1] = new SqlParameter("@AuthJobRoleCode", argRoleDetail.AuthJobRoleCode); param[2] = new SqlParameter("@AuthOrgcode", argRoleDetail.AuthOrgCode); param[3] = new SqlParameter("@ClientCode", argRoleDetail.ClientCode); param[4] = new SqlParameter("@Type", SqlDbType.Char); param[4].Size = 1; param[4].Direction = ParameterDirection.Output; param[5] = new SqlParameter("@Message", SqlDbType.VarChar); param[5].Size = 255; param[5].Direction = ParameterDirection.Output; param[6] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[6].Size = 20; param[6].Direction = ParameterDirection.Output; int i = da.NExecuteNonQuery("Proc_UpdateRoleDetail", param); string strMessage = Convert.ToString(param[5].Value); string strType = Convert.ToString(param[4].Value); string strRetValue = Convert.ToString(param[6].Value); objErrorHandler.Type = strType; objErrorHandler.MsgId = 0; objErrorHandler.Module = ErrorConstant.strInsertModule; objErrorHandler.ModulePart = ErrorConstant.strMasterModule; objErrorHandler.Message = strMessage.ToString(); objErrorHandler.RowNo = 0; objErrorHandler.FieldName = ""; objErrorHandler.LogCode = ""; lstErr.Add(objErrorHandler); return(strRetValue); }
public ICollection <RoleDetail> colGetRoleDetail(string argRoldeCode, string argClientCode) { List <RoleDetail> lst = new List <RoleDetail>(); DataSet DataSetToFill = new DataSet(); RoleDetail tRoleDetail = new RoleDetail(); DataSetToFill = this.GetRoleDetail(argRoldeCode, argClientCode); if (DataSetToFill != null) { foreach (DataRow dr in DataSetToFill.Tables[0].Rows) { lst.Add(objCreateRoleDetail(dr)); } } goto Finish; Finish: DataSetToFill = null; return(lst); }