public JsonResult CreateFee(Fee Fee) { System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { int checkSession = UserLogin.AuthenticateRequest(); int createdBy = Convert.ToInt32(Session["UserID"]); if (checkSession == 0) { return Json(checkSession); } else { //var data = new Fee //{ // ID = FeeId, // Code = code, // Name = name, // ItemNumber = ItemNumber, // ACCPACCode = ACCPACCode, // Description = HttpUtility.UrlDecode(desc), // NeedSecurityDeposit = NeedSecurityDeposit, // Status = status, // CreatedBy = createdBy, // FeeType = FeeType //}; Fee.CreatedBy = createdBy; int result = Fee.InsertFee(); return Json(result); } } catch (Exception ex) { log.Error("Error: " + ex); return Json(""); } finally { log.Debug("End: " + methodBase.Name); } }
private Fee FetchMFee(Fee Fee, SafeDataReader dr) { Fee.Code = dr.GetString("Code"); Fee.Name = dr.GetString("Name"); return Fee; }
private Fee FetchFee(Fee Fee, SafeDataReader dr) { Fee.ID = dr.GetInt32("ID"); Fee.Code = dr.GetString("Code"); Fee.Name = dr.GetString("Name"); Fee.ItemNumber = dr.GetString("ItemNumber"); Fee.ACCPACCode = dr.GetString("ACCPACCode"); Fee.Description = dr.GetString("Description"); Fee.FeeType = dr.GetString("FeeType"); string data = dr.GetString("Description"); if (data.Contains("~^")) { data = data.Replace("~^", Environment.NewLine); } Fee.DescriptionWithBreak = data; Fee.Status = dr.GetBoolean("Status"); Fee.NeedSecurityDeposit = dr.GetBoolean("NeedSecurityDeposit"); Fee.IsUsed = dr.GetInt32("isUsed"); return Fee; }
/// <summary> /// Description : To Get FeeDetails by FeeType /// Created By : Pavan Kumar /// Created Date : 03 July 2015 /// Modified By : /// Modified Date: /// </summary> /// <returns></returns> public static List<Fee> GetFeeDetailsByFeeType(string FeeType) { List<Fee> data = new List<Fee>(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[1]; sqlParams[0] = new SqlParameter("@FeeType", FeeType); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetMFeesByFeeType", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { var Fees = new Fee(); Fees.FetchMFee(Fees, safe); data.Add(Fees); } return data; } catch (Exception ex) { log.Error("Error: " + ex); return data; } finally { log.Debug("End: " + methodBase.Name); } }
/// <summary> /// Description : To Show all the Fee Details in View /// Created By : Pavan Kumar /// Created Date : 30 June 2014 /// Modified By : /// Modified Date: /// </summary> /// <returns>it will give all the Fee details available in database</returns> public static FeeInfo GetAllFees(int startPage, int resultPerPage, string code, string OrderBy, int status) { var data = new FeeInfo(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[5]; sqlParams[0] = new SqlParameter("@startPage", startPage); sqlParams[1] = new SqlParameter("@resultPerPage", resultPerPage); sqlParams[2] = new SqlParameter("@code", code); sqlParams[3] = new SqlParameter("@Status", status); sqlParams[4] = new SqlParameter("@OrderBy", OrderBy); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetAllMFee", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { var Fees = new Fee(); Fees.FetchFee(Fees, safe); data.FeeList.Add(Fees); data.FeeCount = Convert.ToInt32(reader["feeCount"]); } return data; } catch (Exception ex) { log.Error("Error: " + ex); return data; } finally { log.Debug("End: " + methodBase.Name); } }