public ActionResult Duration() { DurationEntity durationEntity = new DurationEntity(); durationEntity.flag = 'G'; durationEntity.reportId = "3"; TempData["DurationData"] = new Master().AddDuration(durationEntity); return(PartialView()); }
public ResultEntity AddDuration(DurationEntity durationEntity) { ResultEntity result = new ResultEntity(); try { SqlParameter[] sqlParameter = new SqlParameter[13]; sqlParameter[0] = new SqlParameter("@DUR_ID", durationEntity.id); sqlParameter[1] = new SqlParameter("@CUSTOMER_ID", objUserEntity.customerId); sqlParameter[2] = new SqlParameter("@USER_ID", objUserEntity.userId); sqlParameter[3] = new SqlParameter("@YEAR_ID", durationEntity.academicYear); sqlParameter[4] = new SqlParameter("@COURSE_ID", durationEntity.courseId); sqlParameter[5] = new SqlParameter("@NO_OF_SEMESTER", durationEntity.semester); sqlParameter[6] = new SqlParameter("@START_DATE", durationEntity.wefDate); sqlParameter[7] = new SqlParameter("@END_DATE", durationEntity.wetDate); sqlParameter[8] = new SqlParameter("@IS_ACTIVE", durationEntity.active); sqlParameter[9] = new SqlParameter("@OPER_TYPE", durationEntity.flag); sqlParameter[10] = new SqlParameter("@REPORT_ID", Convert.ToInt32(durationEntity.reportId)); sqlParameter[11] = new SqlParameter("@FLAG", System.Data.SqlDbType.NVarChar); sqlParameter[11].Direction = ParameterDirection.Output; sqlParameter[11].Size = 1; sqlParameter[12] = new SqlParameter("@MSG", SqlDbType.NVarChar); sqlParameter[12].Direction = ParameterDirection.Output; sqlParameter[12].Size = 500; DataSet ds = new DataSet(); ds = SqlHelper.ExecuteDataset(sqlConn, CommandType.StoredProcedure, "SP_COURSE_DURATION", sqlParameter); result.flag = sqlParameter[11].Value.ToString(); result.msg = sqlParameter[12].Value.ToString(); if (result.flag.ToUpper() == "S") { if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { result.addParams = CommonFunc.DtToJSON(ds.Tables[0]); } } } return(result); } catch (Exception ex) { Excep.WriteException(ex); return(result); } }
public ActionResult Duration(DurationEntity durationEntity) { UserEntity objUserEntity = UserEntity.GetInstance(); return(Json(new Master().AddDuration(durationEntity))); }