public ModulePage objGetModulePage(int iIdModulePage, string argClientCode) { ModulePage argModulePage = new ModulePage(); DataSet DataSetToFill = new DataSet(); if (argClientCode.Trim() == "") { goto ErrorHandlers; } DataSetToFill = this.GetModulePage4ID(iIdModulePage, argClientCode); if (DataSetToFill.Tables[0].Rows.Count <= 0) { goto Finish; } argModulePage = this.objCreateModulePage((DataRow)DataSetToFill.Tables[0].Rows[0]); goto Finish; ErrorHandlers: Finish: DataSetToFill = null; return(argModulePage); }
private ModulePage objCreateModulePage4Menu(DataRow dr) { ModulePage tModulePage = new ModulePage(); tModulePage.SetObjectInfo2(dr); return(tModulePage); }
public void UpdateModulePage(ModulePage argModulePage, DataAccess da, List <ErrorHandler> lstErr) { SqlParameter[] param = new SqlParameter[11]; param[0] = new SqlParameter("@idModulePage", argModulePage.idModulePage); param[1] = new SqlParameter("@ModuleType", argModulePage.ModuleType); param[2] = new SqlParameter("@Module", argModulePage.Module); param[3] = new SqlParameter("@ParentModule", argModulePage.ParentModule); param[4] = new SqlParameter("@parentModuleNode", argModulePage.ParentModuleNode); param[5] = new SqlParameter("@idPModulePage", argModulePage.idPModulePage); param[6] = new SqlParameter("@PageURL", argModulePage.PageURL); param[7] = new SqlParameter("@ClientCode", argModulePage.ClientCode); param[8] = new SqlParameter("@Type", SqlDbType.Char); param[8].Size = 1; param[8].Direction = ParameterDirection.Output; param[9] = new SqlParameter("@Message", SqlDbType.VarChar); param[9].Size = 255; param[9].Direction = ParameterDirection.Output; param[10] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[10].Size = 20; param[10].Direction = ParameterDirection.Output; int i = da.NExecuteNonQuery("Proc_UpdateModulePage", param); string strMessage = Convert.ToString(param[9].Value); string strType = Convert.ToString(param[8].Value); string strRetValue = Convert.ToString(param[10].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); }
public ICollection <ModulePage> colGetModulePage4Menu(string argParentModule, string argClientCode, List <ModulePage> lst) { //List<ModulePage> lst = new List<ModulePage>(); DataSet DataSetToFill = new DataSet(); ModulePage tModulePage = new ModulePage(); DataSetToFill = this.GetModulePage(argParentModule, argClientCode); if (DataSetToFill != null) { foreach (DataRow dr in DataSetToFill.Tables[0].Rows) { lst.Add(objCreateModulePage4Menu(dr)); } } goto Finish; Finish: DataSetToFill = null; return(lst); }
public ICollection <ErrorHandler> SaveModulePage(ModulePage argModulePage) { List <ErrorHandler> lstErr = new List <ErrorHandler>(); DataAccess da = new DataAccess(); try { if (blnIsModulePageExists(argModulePage.idModulePage, argModulePage.ClientCode) == false) { da.Open_Connection(); da.BEGIN_TRANSACTION(); InsertModulePage(argModulePage, da, lstErr); foreach (ErrorHandler objerr in lstErr) { if (objerr.Type == "E") { da.ROLLBACK_TRANSACTION(); return(lstErr); } } da.COMMIT_TRANSACTION(); } else { da.Open_Connection(); da.BEGIN_TRANSACTION(); UpdateModulePage(argModulePage, da, lstErr); foreach (ErrorHandler objerr in lstErr) { if (objerr.Type == "E") { da.ROLLBACK_TRANSACTION(); return(lstErr); } } da.COMMIT_TRANSACTION(); } } catch (Exception ex) { if (da != null) { da.ROLLBACK_TRANSACTION(); } 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); } finally { if (da != null) { da.Close_Connection(); da = null; } } return(lstErr); }