public List <MVCModels.ExpenseEntity> GetExpenseEntity(string companyCode) { List <MVCModels.ExpenseEntity> lstExpenseEntity = new List <MVCModels.ExpenseEntity>(); try { SqlCommand command = new SqlCommand(SP_HDGETEXPENSEENTITY); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objData.OpenConnection(); using (sqlDataReader = _objData.ExecuteReader(command)) { while (sqlDataReader.Read()) { MVCModels.ExpenseEntity _objExpenseEntity = new MVCModels.ExpenseEntity(); _objExpenseEntity.Expense_Entity_Code = sqlDataReader["Expense_Entity_Code"].ToString(); _objExpenseEntity.Expense_Entity_Name = sqlDataReader["Expense_Entity_Name"].ToString(); lstExpenseEntity.Add(_objExpenseEntity); } } } catch (Exception ex) { DataControl.Impl.ExceptionHandler.WriteLog(ex: ex, dic: null); throw ex; } finally { _objData.CloseConnection(); } return(lstExpenseEntity); }
public DataSet GetTpconsolidatedReport(string UserCode, string Month, string Year, string company_Code) { _objData = new Data(); DataSet ds = new DataSet(); try { SqlCommand cmd = new SqlCommand("HD_SP_TpReport"); cmd.CommandType = CommandType.StoredProcedure; AddParamToSqlCommand(cmd, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, company_Code); AddParamToSqlCommand(cmd, "@Month", ParameterDirection.Input, SqlDbType.Int, 8, Month); AddParamToSqlCommand(cmd, "@year", ParameterDirection.Input, SqlDbType.Int, 8, Year); AddParamToSqlCommand(cmd, "@user_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, UserCode); //cmd.Parameters.Add("@Company_Code", company_Code); //cmd.Parameters.Add("@Month", Month); //cmd.Parameters.Add("@year", Year); //cmd.Parameters.Add("@user_Code", UserCode); _objData.OpenConnection(); ds = _objData.ExecuteDataSet(cmd); _objData.CloseConnection(); } catch (Exception ex) { throw ex; } finally { _objData.CloseConnection(); } return(ds); }
public bool InsertHelpDescription(string pageId, string controlId, string helpItemId, string helpDescrip, out string errorMsg) { try { SPData _objSPData = new SPData(); SqlCommand command = new SqlCommand(SPHDINSERTHELPDESCRP); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@PageId", ParameterDirection.Input, SqlDbType.VarChar, 100, pageId); _objSPData.AddParamToSqlCommand(command, "@ControlId", ParameterDirection.Input, SqlDbType.VarChar, 100, controlId); _objSPData.AddParamToSqlCommand(command, "@HelpItemId", ParameterDirection.Input, SqlDbType.VarChar, 100, helpItemId); _objSPData.AddParamToSqlCommand(command, "@HelpDescrp", ParameterDirection.Input, SqlDbType.VarChar, helpDescrip.Length, helpDescrip); _objData.OpenConnection_Global(); DataSet dsConnectionString = _objData.ExecuteDataSet(command); errorMsg = string.Empty; return(true); } catch (Exception ex) { errorMsg = ex.Message; return(false); } finally { _objData.CloseConnection(); } }
public JsonResult GetActicitySummary(FormCollection coll) { try { DataControl.JSONConverter objJson = new DataControl.JSONConverter(); DataSet dsActivity = new DataSet(); string toDate = DateTime.Now.ToShortDateString(); string fromDate = string.Empty; //fromDate = toDate.Split('-')[0] + "-" + toDate.Split('-')[1] + "-01"; fromDate = DateTime.Now.Month + "/01/" + DateTime.Now.Year; objData.OpenConnection(objCurr.GetCompanyCode()); { dsActivity = objData.ExecuteDataSet("exec SP_hdGetActivitySummaryIR '" + objCurr.GetCompanyCode() + "','" + objCurr.GetUserCode() + "','" + fromDate + "','" + toDate + "'"); } return(Json(objJson.Serialize(dsActivity))); } catch (Exception ex) { throw ex; } finally { objData.CloseConnection(); } }
public List <KYDModel> DuplicateValidationOnKYD(string company_Code, string key_Column, IEnumerable <KYDModel> IlstKYDModel) { List <KYDModel> lstKYD = new List <KYDModel>(); try { _objSPData = new SPData(); _objData = new Data(); string cmdText = SPHD_KYDCHECKDUPLICATEENTRY; SqlCommand command = new SqlCommand(cmdText); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, company_Code); _objSPData.AddParamToSqlCommand(command, "@Key_Column", ParameterDirection.Input, SqlDbType.VarChar, 20, key_Column); if (((List <KYDModel>)IlstKYDModel).Count == 0) { _objSPData.AddParamToSqlCommandWithTypeName(command, "@KYD_TEMP", ParameterDirection.Input, SqlDbType.Structured, null, KYD_TYPE_NAME); } else { _objSPData.AddParamToSqlCommandWithTypeName(command, "@KYD_TEMP", ParameterDirection.Input, SqlDbType.Structured, new KYDEnumurator(IlstKYDModel), KYD_TYPE_NAME); } _objData.OpenConnection(company_Code); // Execuete the data reader. using (SqlDataReader dataReader = _objData.ExecuteReader(command)) { while (dataReader.Read()) { KYDModel KYD = new KYDModel(); KYD.Doctor_Code = dataReader["Doctor_Code"].ToString(); KYD.Doctor_Region_Code = dataReader["Doctor_Region_Code"].ToString(); KYD.Registration_No = dataReader["Registration_No"].ToString(); KYD.Mobile = dataReader["Mobile"].ToString(); KYD.Email_Id = dataReader["Email"].ToString(); lstKYD.Add(KYD); } } _objData.CloseConnection(); // returns the list. return(lstKYD); } catch { _objData.CloseConnection(); throw; } }
public DataSet GetLeaveTypeDetails(string companycode) { DataSet ds; _objSPData = new SPData(); _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_HD_GetLeaveDeatils); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@companycode", ParameterDirection.Input, SqlDbType.VarChar, 30, companycode); _objData.OpenConnection(companycode); ds = _objData.ExecuteDataSet(command); return(ds); } catch { throw; } finally { _objData.CloseConnection(); } }
public int UpdateLeaveType(string CompanyCode, string LeaveTypeCode, string LeaveTypeName, string updatedBy, string updatedDate, string payrollleavetypeCode, string IsLop) { try { _objSPData = new SPData(); _objData = new Data(); SqlCommand command = new SqlCommand(SP_HD_UpdateLeaveType); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, CompanyCode); _objSPData.AddParamToSqlCommand(command, "@LeaveTypeCode", ParameterDirection.Input, SqlDbType.VarChar, 30, LeaveTypeCode); _objSPData.AddParamToSqlCommand(command, "@LeaveTypeName", ParameterDirection.Input, SqlDbType.VarChar, 30, LeaveTypeName); _objSPData.AddParamToSqlCommand(command, "@UpdatedBy", ParameterDirection.Input, SqlDbType.VarChar, 10, updatedBy); _objSPData.AddParamToSqlCommand(command, "@UpdatedDate", ParameterDirection.Input, SqlDbType.VarChar, 10, updatedDate); _objSPData.AddParamToSqlCommand(command, "@PayrollleavetypeCode", ParameterDirection.Input, SqlDbType.VarChar, 30, payrollleavetypeCode); _objSPData.AddParamToSqlCommand(command, "@IsLOP", ParameterDirection.Input, SqlDbType.VarChar, 10, IsLop); _objData.OpenConnection(CompanyCode); string returnvale = _objData.ExecuteScalar(command).ToString(); _objData.CloseConnection(); return(Convert.ToInt32(returnvale)); } catch (Exception ex) { throw ex; } }
//get history table//// public JsonResult GetAllstock(FormCollection collection) { string UserCode = string.Empty; UserCode = collection["UserCode"]; string InwardDate = string.Empty; //InwardDate = collection["InwardDate"]; if (!string.IsNullOrEmpty(collection["InwardDate"].ToString())) { InwardDate = collection["InwardDate"].ToString().Split('-')[2].ToString() + "-" + collection["InwardDate"].ToString().Split('-')[1].ToString() + "-" + collection["InwardDate"].ToString().Split('-')[0].ToString(); } //InwardDate = Convert.ToDateTime(collection["InwardDate"].ToString()).ToString("yyyy-MM-dd"); DataControl.Data ds = new DataControl.Data(); DataSet dssub = new DataSet(); ds.OpenConnection(_objCurrentInfo.GetCompanyCode()); { string StrSQL = "EXEC SP_hdInwardStockValue " + "'" + _objCurrentInfo.GetCompanyCode() + "','" + UserCode + "','" + InwardDate + "'"; dssub = ds.ExecuteDataSet(StrSQL); ds.CloseConnection(); } DataTable dt = new DataTable(); dt = dssub.Tables[0]; List <Models.InwardModel> lstMOdel = (from c in dt.AsEnumerable() select new Models.InwardModel { InwardDate = c["Inward Date"].ToString(), product = c["Product"].ToString(), count = c["Count"].ToString(), }).ToList <Models.InwardModel>(); return(Json(lstMOdel, JsonRequestBehavior.AllowGet)); }
//sample product method// public JsonResult GetAllproduct(FormCollection collection) { DataControl.Data ds = new DataControl.Data(); try { string UserCode = string.Empty; DataSet dssub = new DataSet(); ds.OpenConnection(objCurrentInfo.GetCompanyCode()); { string StrSQL = "EXEC USP_hdGetActivityTypeMapping " + "'" + objCurrentInfo.GetCompanyCode() + "'"; dssub = ds.ExecuteDataSet(StrSQL); } DataTable dt = new DataTable(); dt = dssub.Tables[0]; List <Models.SalestypeMapping> lstMOdel = (from c in dt.AsEnumerable() select new Models.SalestypeMapping { ProductName = c["Product_Name"].ToString(), BrandName = c["Brand_Name"].ToString(), SpecialityName = c["Speciality_Name"].ToString(), Productcode = c["Product_code"].ToString(), }).ToList <Models.SalestypeMapping>(); return(Json(lstMOdel, JsonRequestBehavior.AllowGet)); } finally { ds.CloseConnection(); } }
public bool IsEDAvailable(string companyCode, string userTypeCode) { try { int count = 0; SqlCommand command = new SqlCommand(SPEDCHECKEDACCESS); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserTypeCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userTypeCode); _objData.OpenConnection(); count = (int)_objData.ExecuteScalar(command); if (count > 0) { return(true); } else { return(false); } } finally { _objData.CloseConnection(); } }
public DataSet GetDailyCallPlannerDoctorDetails(string companyCode, string userCode, string regionCode, string month, string year, string fromDate, string dcrDate) { DataSet ds = new DataSet(); SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_HD_V4_GetDailyPlanDoctorYTD); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@RegionCode", ParameterDirection.Input, SqlDbType.VarChar, 30, regionCode); _objSPData.AddParamToSqlCommand(command, "@Month", ParameterDirection.Input, SqlDbType.VarChar, 5, month); _objSPData.AddParamToSqlCommand(command, "@YEAR", ParameterDirection.Input, SqlDbType.VarChar, 5, year); _objSPData.AddParamToSqlCommand(command, "@FromDate", ParameterDirection.Input, SqlDbType.VarChar, 15, fromDate); _objSPData.AddParamToSqlCommand(command, "@DCRDate", ParameterDirection.Input, SqlDbType.VarChar, 15, dcrDate); _objData.OpenConnection(companyCode); ds = _objData.ExecuteDataSet(command); return(ds); } catch { throw; } finally { _objData.CloseConnection(); } }
public DataSet GetInstantReportDetails(string companyCode, string userCode, string regionCode, string dcrActualDate, string dcrCode, string flag) { SPData _objSPData = new SPData(); Data _objData = new Data(); try { string cmdText = SP_HD_V4_GetUserPerDayReport; SqlCommand command = new SqlCommand(cmdText); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@RegionCode", ParameterDirection.Input, SqlDbType.VarChar, 30, regionCode); _objSPData.AddParamToSqlCommand(command, "@DCRActualDate", ParameterDirection.Input, SqlDbType.VarChar, 12, dcrActualDate); _objSPData.AddParamToSqlCommand(command, "@DCRCode", ParameterDirection.Input, SqlDbType.VarChar, 50, dcrCode); _objSPData.AddParamToSqlCommand(command, "@Flag", ParameterDirection.Input, SqlDbType.VarChar, 1, flag); DataSet ds = new DataSet(); _objData.OpenConnection(companyCode); ds = _objData.ExecuteDataSet(command); return(ds); } finally { _objData.CloseConnection(); } }
public string GetAttendanceDetail(string companyCode, string userCode, string dcrDate) { string result = string.Empty; SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_HD_V4_GetTPAttendanceDetails); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@DCRDate", ParameterDirection.Input, SqlDbType.VarChar, 15, dcrDate); _objData.OpenConnection(companyCode); result = Convert.ToString(_objData.ExecuteScalar(command)); return(result); } catch { throw; } finally { _objData.CloseConnection(); } }
public string InsertBrand(FormCollection collection) { string result = ""; DataControl.Data ds = new DataControl.Data(); try { DataSet dsTrans = new DataSet(); ds.OpenConnection(objCurInfo.GetCompanyCode()); { string CompanyCode = objCurInfo.GetCompanyCode(); string BrandName = collection["BrandName"].ToString(); string BrandCode = collection["BrandCode"].ToString(); string Mode = collection["Mode"].ToString(); string strSQL = "EXEC sp_sdInsertBrand '" + CompanyCode + "','" + BrandName + "','" + BrandCode + "','" + Mode + "'"; result = (string)ds.ExecuteScalar(strSQL); } return(result); } finally { ds.CloseConnection(); } }
public DataTable GetNonSampleGivenYTD(string companyCode, string userCode, string fromDate, string customerCode) { DataTable dt = new DataTable(); SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_hdGetGiftsGivenYTD); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@FromDate", ParameterDirection.Input, SqlDbType.VarChar, 15, fromDate); _objSPData.AddParamToSqlCommand(command, "@CustomerCode", ParameterDirection.Input, SqlDbType.VarChar, 30, customerCode); _objData.OpenConnection(companyCode); dt = _objData.ExecuteDataTable(command); return(dt); } catch { throw; } finally { _objData.CloseConnection(); } }
public DataTable GetCompetitorBrandProducts(string companyCode, string userCode, string year, string month, string customerCode) { DataTable dt = new DataTable(); SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_hdGetCompetitorBrandProducts); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@Year", ParameterDirection.Input, SqlDbType.VarChar, 5, year); _objSPData.AddParamToSqlCommand(command, "@Month", ParameterDirection.Input, SqlDbType.VarChar, 5, month); _objSPData.AddParamToSqlCommand(command, "@CustomerCode", ParameterDirection.Input, SqlDbType.VarChar, 30, customerCode); _objData.OpenConnection(companyCode); dt = _objData.ExecuteDataTable(command); return(dt); } catch { throw; } finally { _objData.CloseConnection(); } }
public JsonResult GetDCRAppliedUsers(FormCollection collection) { try { DataSet dsCategory = new DataSet(); objData.OpenConnection(_objCurrentInfo.GetCompanyCode()); { dsCategory = objData.ExecuteDataSet("exec SP_mhdGetDCRAppliedUsers '" + _objCurrentInfo.GetCompanyCode() + "','" + _objCurrentInfo.GetUserCode() + "','" + collection["DCRActualMonth"].ToString() + "','" + collection["DCRActualYear"].ToString() + "','" + collection["Status"].ToString() + "','" + collection["Selection"].ToString() + "','" + collection["UserName"].ToString() + "'"); } return(Json(_objJson.Serialize(dsCategory), JsonRequestBehavior.AllowGet)); } finally { objData.CloseConnection(); } }
public DataTable GetDoctorProductMappingDetail(string companyCode, string customerCode, string regionCode) { DataTable dt = new DataTable(); SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_hdGetDoctorProductMappimgDetail); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@CustomerCode", ParameterDirection.Input, SqlDbType.VarChar, 30, customerCode); _objSPData.AddParamToSqlCommand(command, "@RegionCode", ParameterDirection.Input, SqlDbType.VarChar, 30, regionCode); _objData.OpenConnection(companyCode); dt = _objData.ExecuteDataTable(command); return(dt); } catch { throw; } finally { _objData.CloseConnection(); } }
public string GetCpLastEnteredDate(string usercode, string cpcode, DateTime tp_date, string companyCode) { _objData = new Data(); string cpstatus = "no"; try { SqlCommand command = new SqlCommand(HD_GET_GETCPENTEREDDATE); command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 400; AddParamToSqlCommand(command, "@companyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); AddParamToSqlCommand(command, "@cp_code", ParameterDirection.Input, SqlDbType.VarChar, 50, cpcode); AddParamToSqlCommand(command, "@usercode", ParameterDirection.Input, SqlDbType.VarChar, 30, usercode); AddParamToSqlCommand(command, "@Tp_Date", ParameterDirection.Input, SqlDbType.Date, 30, tp_date); _objData.OpenConnection(companyCode); using (SqlDataReader dataReader = _objData.ExecuteReader(command)) if (dataReader.HasRows) { while (dataReader.Read()) { cpstatus = dataReader["status"].ToString(); } } } catch (Exception ex) { throw ex; } finally { _objData.CloseConnection(); } return(cpstatus); }
//Get mapping product// public JsonResult GetAllSelectProduct(FormCollection collection) { DataControl.Data ds = new DataControl.Data(); try { string salesproductCode = string.Empty; string Result = string.Empty; salesproductCode = collection["ProductCodeselect"]; DataSet dssub = new DataSet(); ds.OpenConnection(objCurrentInfo.GetCompanyCode()); { string StrSQL = "EXEC SP_HdGet_MappingProductSelect " + "'" + objCurrentInfo.GetCompanyCode() + "','" + salesproductCode + "'"; dssub = ds.ExecuteDataSet(StrSQL); } DataTable dt = new DataTable(); dt = dssub.Tables[0]; List <Models.SalestypeMapping> lstMOdel = (from c in dt.AsEnumerable() select new Models.SalestypeMapping { Productcode = c["Sales_Product_Code"].ToString(), SalesMappingcode = c["Mapping_Product_Code"].ToString(), }).ToList <Models.SalestypeMapping>(); return(Json(lstMOdel, JsonRequestBehavior.AllowGet)); } finally { ds.CloseConnection(); } }
public DataTable GetDailyCallPlanner(string companyCode, string userCode, string dcrDate) { DataTable dt = new DataTable(); SPData _objSPData = new SPData(); Data _objData = new Data(); try { SqlCommand command = new SqlCommand(SP_HD_V4_GetDailyPlanHeader); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objSPData.AddParamToSqlCommand(command, "@UserCode", ParameterDirection.Input, SqlDbType.VarChar, 30, userCode); _objSPData.AddParamToSqlCommand(command, "@DCRDate", ParameterDirection.Input, SqlDbType.VarChar, 15, dcrDate); _objData.OpenConnection(companyCode); dt = _objData.ExecuteDataTable(command); return(dt); } catch { throw; } finally { _objData.CloseConnection(); } }
public List <MVCModels.DivisionModel> GetDivisions(string companyCode) { List <MVCModels.DivisionModel> lstDivisions = new List <MVCModels.DivisionModel>(); try { SqlCommand command = new SqlCommand(SP_HDGETALLDIVISIONS); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@CompanyCode", ParameterDirection.Input, SqlDbType.VarChar, 30, companyCode); _objData.OpenConnection(); using (sqlDataReader = _objData.ExecuteReader(command)) { while (sqlDataReader.Read()) { MVCModels.DivisionModel _objDivision = new MVCModels.DivisionModel(); _objDivision.Division_Code = sqlDataReader["Division_Code"].ToString(); _objDivision.Division_Name = sqlDataReader["Division_Name"].ToString(); _objDivision.Lineofbussiness = sqlDataReader["Lineofbussiness"].ToString(); _objDivision.Record_Status = sqlDataReader["Record_Status"].ToString(); _objDivision.divisionline = sqlDataReader["Line_Of_Business"].ToString(); lstDivisions.Add(_objDivision); } } } catch (Exception ex) { Impl.ExceptionHandler.WriteLog(ex: ex, dic: null); throw ex; } finally { _objData.CloseConnection(); } return(lstDivisions); }
public object SetOrder() { string strReturn = ""; Data _objData = new Data(); try { // Creates Instance SPData _objSPData = new SPData(); string cmdText = "SP_HDInsertPOBOrder"; // Set Command object. SqlCommand command = new SqlCommand(cmdText); command.CommandType = CommandType.StoredProcedure; // Add the parameters to command object. if (objOrder.orderAdd.lstHeader.Count == 0) { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_POB_Header", ParameterDirection.Input, SqlDbType.Structured, null, "TVP_POB_Header"); } else { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_POB_Header", ParameterDirection.Input, SqlDbType.Structured, new DCROrderHeaderEnumurator(objOrder.orderAdd.lstHeader), "TVP_POB_Header"); } if (objOrder.orderAdd.lstDetails.Count == 0) { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_POB_Details", ParameterDirection.Input, SqlDbType.Structured, null, "TVP_POB_Details"); } else { _objSPData.AddParamToSqlCommandWithTypeName(command, "@TVP_POB_Details", ParameterDirection.Input, SqlDbType.Structured, new DCROrderDetailsEnumurator(objOrder.orderAdd.lstDetails), "TVP_POB_Details"); } _objSPData.AddParamToSqlCommand(command, "@DCR_Status", ParameterDirection.Input, SqlDbType.VarChar, 30, ""); if (objOrder.orderAdd.lstHeader[0].Order_Id == -1) { _objSPData.AddParamToSqlCommand(command, "@DCR_Actual_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, DateTime.Now.Date.ToShortDateString()); } else { _objSPData.AddParamToSqlCommand(command, "@DCR_Actual_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, objOrder.orderAdd.lstHeader[0].Order_Date); } //_objSPData.AddParamToSqlCommand(command, "@DCR_Visit_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, ""); _objSPData.AddParamToSqlCommand(command, "@Result", ParameterDirection.Output, SqlDbType.VarChar, 500, strReturn); // Opens the connection. _objData.OpenConnection(objOrder.orderInputs.Company_Code); _objData.ExecuteNonQuery(command); } finally { _objData.CloseConnection(); } return(strReturn); }
public int InsertUserLeaveTypeMaster(string Company_Code, string Effective_From, string Effective_To, string IS_Added_Weekend_Holiday, string IS_Added_Holiday, string Leave_Type_Code, string Min_Leave, string Max_Leave, string User_Code, string User_Type_Code, string Created_By, string Created_Date, string User_Leave_Status, string Updated_By, string Updated_Date, string User_Leave_Type_Code, string clubbing, int leaveeligible, string leaveconfirmation, string leaveoncompletion, int noofdays, int applicdays, string validation_Mode, string leave_Occurrence_Count, string leave_Max_Count, string Document_Upload, string consecutvie_Leave_Allowed, string mode) { //int rowsAffected = 0; try { _objSPData = new SPData(); _objData = new Data(); SqlCommand command = new SqlCommand(SP_HD_InsertUserLeaveTypeMapping); command.CommandType = CommandType.StoredProcedure; _objSPData.AddParamToSqlCommand(command, "@Company_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, Company_Code); _objSPData.AddParamToSqlCommand(command, "@Effective_From", ParameterDirection.Input, SqlDbType.VarChar, 30, Effective_From); _objSPData.AddParamToSqlCommand(command, "@Effective_To", ParameterDirection.Input, SqlDbType.VarChar, 30, Effective_To); _objSPData.AddParamToSqlCommand(command, "@IS_Added_Weekend_Holiday", ParameterDirection.Input, SqlDbType.VarChar, 1, IS_Added_Weekend_Holiday); _objSPData.AddParamToSqlCommand(command, "@IS_Added_Holiday", ParameterDirection.Input, SqlDbType.VarChar, 1, IS_Added_Holiday); _objSPData.AddParamToSqlCommand(command, "@Leave_Type_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, Leave_Type_Code); _objSPData.AddParamToSqlCommand(command, "@Min_Leave", ParameterDirection.Input, SqlDbType.VarChar, 8, Min_Leave); _objSPData.AddParamToSqlCommand(command, "@Max_Leave", ParameterDirection.Input, SqlDbType.VarChar, 8, Max_Leave); _objSPData.AddParamToSqlCommand(command, "@User_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, User_Code); _objSPData.AddParamToSqlCommand(command, "@User_Type_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, User_Type_Code); _objSPData.AddParamToSqlCommand(command, "@User_Leave_Type_Code", ParameterDirection.Input, SqlDbType.VarChar, 30, User_Leave_Type_Code); _objSPData.AddParamToSqlCommand(command, "@User_Leave_Status", ParameterDirection.Input, SqlDbType.VarChar, 30, User_Leave_Status); _objSPData.AddParamToSqlCommand(command, "@Created_By", ParameterDirection.Input, SqlDbType.VarChar, 30, Created_By); _objSPData.AddParamToSqlCommand(command, "@Created_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, Created_Date); _objSPData.AddParamToSqlCommand(command, "@Updated_By", ParameterDirection.Input, SqlDbType.VarChar, 30, Updated_By); _objSPData.AddParamToSqlCommand(command, "@Updated_Date", ParameterDirection.Input, SqlDbType.VarChar, 30, Updated_Date); _objSPData.AddParamToSqlCommand(command, "@clubbing", ParameterDirection.Input, SqlDbType.VarChar, 200, clubbing); _objSPData.AddParamToSqlCommand(command, "@leaveeligible", ParameterDirection.Input, SqlDbType.Int, 32, leaveeligible); _objSPData.AddParamToSqlCommand(command, "@leaveconfirmation", ParameterDirection.Input, SqlDbType.VarChar, 10, leaveconfirmation); _objSPData.AddParamToSqlCommand(command, "@leaveoncompletion", ParameterDirection.Input, SqlDbType.VarChar, 10, leaveoncompletion); _objSPData.AddParamToSqlCommand(command, "@noofdays", ParameterDirection.Input, SqlDbType.Int, 32, noofdays); _objSPData.AddParamToSqlCommand(command, "@applicdays", ParameterDirection.Input, SqlDbType.Int, 32, applicdays); _objSPData.AddParamToSqlCommand(command, "@Validation_Mode", ParameterDirection.Input, SqlDbType.VarChar, 1, validation_Mode); _objSPData.AddParamToSqlCommand(command, "@Leave_Occurrence_Count", ParameterDirection.Input, SqlDbType.VarChar, 10, leave_Occurrence_Count); _objSPData.AddParamToSqlCommand(command, "@Leave_Max_Count", ParameterDirection.Input, SqlDbType.VarChar, 10, leave_Max_Count); _objSPData.AddParamToSqlCommand(command, "@Document_Upload", ParameterDirection.Input, SqlDbType.VarChar, 10, Document_Upload); _objSPData.AddParamToSqlCommand(command, "@Consecutvie_Leave_Allowed", ParameterDirection.Input, SqlDbType.VarChar, 10, consecutvie_Leave_Allowed); _objSPData.AddParamToSqlCommand(command, "@mode", ParameterDirection.Input, SqlDbType.VarChar, 30, mode); _objData.OpenConnection(Company_Code); string returnvalue = _objData.ExecuteScalar(command).ToString(); _objData.CloseConnection(); return(Convert.ToInt32(returnvalue)); } catch (Exception ex) { throw ex; } }
public JsonResult GetNewReportsMenu(FormCollection collection) { try { _objData.OpenConnection(_objcurrentInfo.GetCompanyCode()); DataSet ds = _objData.ExecuteDataSet("exec SP_hdGetUserMenuScreen '" + _objcurrentInfo.GetCompanyCode() + "', '" + _objcurrentInfo.GetUserTypeCode() + "'"); DataControl.JSONConverter json = new DataControl.JSONConverter(); return(Json(json.Serialize(ds), JsonRequestBehavior.AllowGet)); } finally { _objData.CloseConnection(); } }
public JsonResult GetExpenseTypeDetails(FormCollection coll) { try { DataControl.JSONConverter objJson = new DataControl.JSONConverter(); DataSet dsExpenseDetails = new DataSet(); _objData.OpenConnection(_objCurr.GetCompanyCode()); { dsExpenseDetails = _objData.ExecuteDataSet("exec SP_hdGetExpenseTypeDetails '" + _objCurr.GetCompanyCode() + "'"); } return(Json(objJson.Serialize(dsExpenseDetails))); } catch (Exception ex) { throw ex; } finally { _objData.CloseConnection(); } }
private string GetNextTwoPossibleDays(string dcrDate) { try { string possibleDays = string.Empty; objData.OpenConnection(objCurr.GetCompanyCode()); { possibleDays = Convert.ToString(objData.ExecuteScalar("exec SP_hdGetNextTwoPossibleDays '" + objCurr.GetCompanyCode() + "','" + objCurr.GetUserCode() + "','" + objCurr.GetRegionCode() + "','" + dcrDate + "'")); } return(possibleDays); } finally { objData.CloseConnection(); } }
public JsonResult GetNotification(FormCollection collection) { try { DataSet dsCategory = new DataSet(); objData.OpenConnection(objCurr.GetCompanyCode()); { dsCategory = objData.ExecuteDataSet("exec SP_mhdGetNotification '" + objCurr.GetCompanyCode() + "','" + objCurr.GetUserCode() + "'"); } return(Json(_objJson.Serialize(dsCategory), JsonRequestBehavior.AllowGet)); } finally { objData.CloseConnection(); } }
//get user data table// public JsonResult GetAllInward(FormCollection collection) { string UserCode = string.Empty; UserCode = collection["UserCode"]; string inwardDate = collection["InwardDate"]; DataControl.Data ds = new DataControl.Data(); DataSet dssub = new DataSet(); ds.OpenConnection(_objCurrentInfo.GetCompanyCode()); { string StrSQL = "EXEC Sp_HdUserProduct_select " + "'" + _objCurrentInfo.GetCompanyCode() + "','" + UserCode + "','" + inwardDate + "'"; dssub = ds.ExecuteDataSet(StrSQL); ds.CloseConnection(); } DataTable dt = new DataTable(); DataTable dtBatch = new DataTable(); dt = dssub.Tables[0]; dtBatch = dssub.Tables[1]; List <Models.InwardModel> lstMOdel = (from c in dt.AsEnumerable() select new Models.InwardModel { ProductTypeName = c["Product_Type_Name"].ToString(), ProductName = c["Product_Name"].ToString(), CurrentStock = c["Current_Stock"].ToString(), ProductCode = c["Product_Code"].ToString(), Effective_Status = Convert.ToInt32(c["Effective_Status"].ToString()), }).ToList <Models.InwardModel>(); List <Models.InwardBatch> lstBatch = (from c in dtBatch.AsEnumerable() select new Models.InwardBatch { UPB_ID = Convert.ToInt32(c["UPB_ID"].ToString()), Product_Code = c["Product_Code"].ToString(), Batch_Number = c["Batch_Number"].ToString(), Effective_From = c["Effective_From"].ToString(), Effective_To = c["Effective_To"].ToString(), Expiry_Date = c["Expiry_Date"].ToString(), Effective_Status = Convert.ToInt32(c["Effective_Status"].ToString()), Batch_Status = Convert.ToInt32(c["Batch_Status"].ToString()), Current_Stock = Convert.ToInt32(c["Current_Stock"].ToString()), }).ToList <Models.InwardBatch>(); return(Json(new { Product = lstMOdel, Batch = lstBatch }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetTargetHeader(FormCollection collection) { try { DataSet ds = new DataSet(); _objData.OpenConnection(_objCurr.GetCompanyCode()); { ds = _objData.ExecuteDataSet("exec SP_hdGetTargetHeader '" + _objCurr.GetCompanyCode() + "','" + collection["RegionCode"].ToString() + "'"); } return(Json(_objJson.Serialize(ds), JsonRequestBehavior.AllowGet)); } finally { _objData.CloseConnection(); } }