public bool CreateRoaster(string Prifix,out string roosternumber) { bool isFlag = false; try { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_CREATEROASTERNO; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@Prefix", Prifix); param[1] = new SqlParameter("@RoosterNumber", SqlDbType.NVarChar, 20); param[1].Direction = ParameterDirection.Output; ObjSqlHelper.ExecNonQueryProc(proc_name, param); roosternumber = param[1].Value.ToString(); if (roosternumber != null && roosternumber !="") isFlag = true; } catch(Exception ex) { isFlag = false; throw; } return isFlag; }
public bool CancelRequest(int RequestId) { string proc_name = ConstantsDLL.USP_CANCELONDEMANDREQUEST; SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@OnDemandID", RequestId); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
/// <summary> /// Method to make ActiveInActive Driver /// </summary> /// <param name="vendor"></param> /// <returns></returns> public bool ActiveInactiveDriverDeatil(string DriverId, bool ActiveInactive, string ModifiedBy) { string proc_name = ConstantsDLL.USP_ActiveInactiveDriver; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@DriverId", DriverId); param[1] = new SqlParameter("@IsActive", ActiveInactive); param[2] = new SqlParameter("@ModifiedBy", ModifiedBy); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
public bool DeleteDC(string DCId, bool IsActive, string Modifiedby) { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_DELETEDC; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@DCId", DCId); param[1] = new SqlParameter("@IsActive", IsActive); param[2] = new SqlParameter("@ModifyBy", Modifiedby); ObjSqlHelper.ExecNonQueryProc(proc_name, param); return true; }
/// <summary> /// Method to active or deactivate the vendor with comment option /// </summary> /// <param name="VendorId"></param> /// <param name="IsActive"></param> /// <param name="IsActiveComment"></param> /// <param name="ModifiedBy"></param> /// <returns></returns> public bool Active_InactiveVendor(string VendorIds,bool IsActive,string IsActiveComment,string ModifiedBy) { string proc_name = ConstantsDLL.USP_ACTIVEINACTIVEVENDOR; SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@VendorIDs",VendorIds); param[1] = new SqlParameter("@IsActive",IsActive); param[2] = new SqlParameter("@IsActiveComment", IsActiveComment); param[3] = new SqlParameter("@ModifiedBy", ModifiedBy); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
/// <summary> /// Method to Delete RoleDetail /// </summary> /// <returns></returns> public bool DeleteRole(string RoleId, bool IsActive, string Modifiedby) { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_ACTIVEINACTIVEROLE; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@RoleId", RoleId); param[1] = new SqlParameter("@IsActive", IsActive); param[2] = new SqlParameter("@ModifyBy", Modifiedby); ObjSqlHelper.ExecNonQueryProc(proc_name, param); return true; }
public bool ActiveInactiveUser(string UserID, bool ActiveInactive, string ModifiedBy) { string proc_name = ConstantsDLL.USP_ACTIVEINACTIVEUSER; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@OndemandRequestID", UserID); param[1] = new SqlParameter("@IsActive", ActiveInactive); param[2] = new SqlParameter("@ModifiedBy", ModifiedBy); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
public bool Active_InactiveShift(string ShiftIds, bool IsActive, string ModifiedBy) { string proc_name = ConstantsDLL.USP_ACTIVEINACTIVESHIFT; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@ShiftIds", ShiftIds); param[1] = new SqlParameter("@IsActive",IsActive); param[2] = new SqlParameter("@ModifiedBy",ModifiedBy); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
public bool ApproveUserRequest(string UserId, string ModifiedBy, string Comment) { string proc_name = ConstantsDLL.USP_APPROVEUSERREQUEST; SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@OndemandRequestID", UserId); param[1] = new SqlParameter("@ModifiedBy", ModifiedBy); param[2] = new SqlParameter("@Comment", Comment); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
public Int32 DeleteRouteMaster(RouteMaster ObjRouteMaster) { ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] oPara = { new SqlParameter("@DPID", SqlDbType.VarChar), new SqlParameter("@IsActive", SqlDbType.Int), new SqlParameter("@ModifiedBy", SqlDbType.VarChar), new SqlParameter("@Rval", SqlDbType.Int) }; oPara[0].Value = ObjRouteMaster.RouteIDs; oPara[0].Size = 255; oPara[1].Value = ObjRouteMaster.IsActive; oPara[1].Size = 155; oPara[2].Value = ObjRouteMaster.ModifiedBy; oPara[2].Size = 255; oPara[3].Direction = ParameterDirection.ReturnValue; ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_DeleteRoute, oPara); return Convert.ToInt32(oPara[3].Value); }
/// <summary> /// Method to Update Driver DETAIL /// </summary> /// <returns></returns> /// public Int32 UpdateDriverDetail(DriverDetail DriverDetail) { ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] oPara = { new SqlParameter("@DriverId",SqlDbType.Int), new SqlParameter("@DriverName",SqlDbType.VarChar), new SqlParameter("@DriverCode", SqlDbType.Int), new SqlParameter("@DCID", SqlDbType.Int), new SqlParameter("@EmpanelDate", SqlDbType.VarChar), new SqlParameter("@ModifBy", SqlDbType.VarChar), new SqlParameter("@IsActive", SqlDbType.Bit), new SqlParameter("@Rval", SqlDbType.Int), }; oPara[0].Value = DriverDetail.DriverId; oPara[0].Size = 155; oPara[1].Value = DriverDetail.DriverName; oPara[1].Size = 155; oPara[2].Value = DriverDetail.DriverCode; oPara[2].Size = 155; oPara[3].Value = DriverDetail.DCID; oPara[3].Size = 255; oPara[4].Value = DriverDetail.EmpanelDate; oPara[4].Size = 255; oPara[5].Value = DriverDetail.ModifyBy; oPara[5].Size = 255; oPara[6].Value = DriverDetail.IsActive; oPara[6].Size = 255; oPara[7].Direction = ParameterDirection.ReturnValue; ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_UpdateDriverDetail, oPara); return Convert.ToInt32(oPara[7].Value); }
public string UpdateShift(Shift shift) { string proc_name = ConstantsDLL.USP_UPDATESHIFTINFO; SqlParameter[] param = new SqlParameter[7]; param[0] = new SqlParameter("@ShiftId", shift.ShiftId); param[1] = new SqlParameter("@ShiftCategory", shift.ShiftCategory); param[2] = new SqlParameter("@ShiftType",shift.ShiftType); param[3] = new SqlParameter("@ShiftTime",shift.ShiftTime); param[4] = new SqlParameter("@DCID", shift.DCID); param[5] = new SqlParameter("@ModifiedBy",shift.ModifiedBy); string Result = ""; param[6] = new SqlParameter("@Result", SqlDbType.VarChar, 50, Result); param[6].Direction = ParameterDirection.Output; using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } Result = Convert.ToString(param[6].Value); return Result; }
/// <summary> /// Method to Insert Roaster /// </summary> /// <returns></returns> public bool InsertRosterDetail(RoasterManagement RoasterManagement) { bool isFlag = false; try { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_INSERTROASTERDETAIL; SqlParameter[] param = new SqlParameter[1]; DataTable dt = new DataTable(); dt=RoasterManagement.RosterDetailDT; dt.Columns.Remove("Row"); dt.Columns.Remove("CabNoValid"); dt.Columns.Remove("RouteNameValid"); dt.Columns.Remove("Signature"); dt.Columns.Remove("CabCapacityValid"); dt.Columns.Remove("CabPropertyValid"); dt.Columns.Remove("EmployeNoValid"); dt.Columns.Remove("CabCapacity"); param[0] = new SqlParameter("@TableVar", dt); ObjSqlHelper.ExecNonQueryProc(proc_name, param); isFlag=true; } catch(Exception ex) { isFlag = false; throw; } return isFlag; }
/// <summary> /// Method to make modification in vendor /// </summary> /// <param name="vendor"></param> /// <returns></returns> public Int32 UpdateVendor(Vendor vendor) { ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] oPara = { new SqlParameter("@VendorID", SqlDbType.Int), new SqlParameter("@VendorName", SqlDbType.VarChar), new SqlParameter("@Address", SqlDbType.VarChar), new SqlParameter("@City", SqlDbType.VarChar), new SqlParameter("@EmpanelDate",SqlDbType.VarChar), new SqlParameter("@DCID", SqlDbType.Int), new SqlParameter("Comment",SqlDbType.VarChar), new SqlParameter("ModifiedBy",SqlDbType.VarChar), new SqlParameter("@Rval", SqlDbType.Int) }; oPara[0].Value = vendor.VendorID; oPara[0].Size = 155; oPara[1].Value = vendor.VendorName.Trim(); oPara[1].Size = 155; oPara[2].Value = vendor.Address; oPara[2].Size = 255; oPara[3].Value = vendor.City; oPara[3].Size=255; oPara[4].Value = vendor.EmpanelDate; oPara[4].Size = 255; oPara[5].Value = vendor.DCID; oPara[5].Size = 255; oPara[6].Value = vendor.Comment; oPara[6].Size = 255; oPara[7].Value = vendor.ModifiedBy; oPara[7].Size = 255; oPara[8].Direction = ParameterDirection.ReturnValue; ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_UPDATEVENDOR, oPara); return Convert.ToInt32(oPara[8].Value); }
/// <summary> /// Method to insert the details for creating new vendor /// </summary> /// <param name="vendor"></param> /// <returns></returns> public int InsertVendor(Vendor vendor) { //string proc_name = ConstantsDLL.USP_INSERTVENDOR; ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] param = { new SqlParameter("@VendorName",SqlDbType.VarChar), new SqlParameter("@Address",SqlDbType.VarChar), new SqlParameter("@City", SqlDbType.VarChar), new SqlParameter("@EmpanelDate",SqlDbType.Date), new SqlParameter("@DCID", SqlDbType.Int), new SqlParameter("@Comment",SqlDbType.VarChar), new SqlParameter("@CreatedBy",SqlDbType.VarChar), new SqlParameter("@rVal",SqlDbType.Int) }; param[0].Value = vendor.VendorName; param[0].Size = 255; param[1].Value = vendor.Address; param[1].Size = 155; param[2].Value = vendor.City; param[2].Size = 255; param[3].Value = vendor.EmpanelDate; param[3].Size = 255; param[4].Value = vendor.DCID; param[4].Size = 155; param[5].Value = vendor.Comment; param[5].Size = 255; param[6].Value = vendor.CreatedBy; param[6].Size = 255; param[7].Direction = ParameterDirection.ReturnValue; ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_INSERTVENDOR, param); //using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) //{ // db.ExecNonQueryProc(proc_name, param); //} //return true; return Convert.ToInt32(param[7].Value); }
public bool UpdateRosterDetail(RoasterManagement RoasterManagement) { bool isFlag = false; try { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_UPDATEROASTERDETAIL; SqlParameter[] param = new SqlParameter[1]; //param[0] = new SqlParameter("@PreFix", RoasterManagement.PreFix); //param[0] = new SqlParameter("@Client", RoasterManagement.Client); //param[1] = new SqlParameter("@ProjectCode", RoasterManagement.ProjectCode); //param[2] = new SqlParameter("@PickupDropDate", RoasterManagement.PickupDropDate); //param[3] = new SqlParameter("@TotalEmployee", RoasterManagement.TotalEmployee); //param[4] = new SqlParameter("@RouteName", RoasterManagement.RouteName); //param[5] = new SqlParameter("@LandmarkName", RoasterManagement.LandmarkName); //param[6] = new SqlParameter("@TypeOfPickupDrop", RoasterManagement.TypeOfPickupDrop); //param[7] = new SqlParameter("@ShiftTimings", RoasterManagement.ShiftTimings); //param[8] = new SqlParameter("@CabType", RoasterManagement.CabType); //param[9] = new SqlParameter("@Vendor", RoasterManagement.Vendor); //param[10] = new SqlParameter("@EndUser", RoasterManagement.EndUser); //param[11] = new SqlParameter("@Guard", RoasterManagement.Guard); //param[12] = new SqlParameter("@CabNo", RoasterManagement.CabNo); DataTable dt = new DataTable(); dt = RoasterManagement.RosterDetailDT; dt.Columns.Remove("Row"); dt.Columns.Remove("CabNoValid"); dt.Columns.Remove("RouteNameValid"); dt.Columns.Remove("Signature"); dt.Columns.Remove("CabCapacityValid"); dt.Columns.Remove("CabPropertyValid"); dt.Columns.Remove("EmployeNoValid"); dt.Columns.Remove("CabCapacity"); param[0] = new SqlParameter("@TableVar", dt); ObjSqlHelper.ExecNonQueryProc(proc_name, param); isFlag = true; } catch (Exception ex) { isFlag = false; throw; } return isFlag; }
public string UpdateDC(DC roledetail) { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_UPDATEDC; SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@DCId", roledetail.DCID); param[1] = new SqlParameter("@IsActive", roledetail.IsActive); param[2] = new SqlParameter("@ModifyBy", roledetail.ModifiedBy); param[3] = new SqlParameter("@DCName", roledetail.DCName); string Result = ""; param[4] = new SqlParameter("@Result", SqlDbType.VarChar, 50, Result); param[4].Direction = ParameterDirection.Output; using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) // ObjSqlHelper.ExecNonQueryProc(proc_name, param); { db.ExecNonQueryProc(proc_name, param); } Result = Convert.ToString(param[4].Value); return Result; // return true; }
public string InsertDC(DC roledetail) { string outResult = string.Empty; ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_INSERTDC; SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@DCName", roledetail.DCName); param[1] = new SqlParameter("@IsActive", roledetail.IsActive); param[2] = new SqlParameter("@CreatedBy", roledetail.CreatedBy); param[3] = new SqlParameter("@Result", outResult); param[3].Direction = ParameterDirection.Output; ObjSqlHelper.ExecNonQueryProc(proc_name, param); outResult = Convert.ToString(param[3].Value); // ObjSqlHelper.ExecNonQueryProc(proc_name, param); return outResult; }
/// <summary> /// Method to Get RoleAcess Id /// </summary> /// <returns></returns> public Int32 GetRoleid(string RoleName) { Int32 RoleId=0; ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_GETROLEID; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@RoleName", RoleName); param[1] = new SqlParameter("@RoleId", RoleId); param[1].Direction = ParameterDirection.Output; ObjSqlHelper.ExecNonQueryProc(proc_name, param); RoleId = Convert.ToInt32((param[1].Value)); return RoleId; }
public bool UpdateRequest(OnDemandRequest Request) { string proc_name = ConstantsDLL.USP_UPDATEONDEMANDREQUEST; SqlParameter[] param = new SqlParameter[8]; param[0] = new SqlParameter("@OnDemandID", Request.OndemandRequestId); param[1] = new SqlParameter("@Approver", Request.Approver); param[2] = new SqlParameter("@Address", Request.Address); // param[3] = new SqlParameter("@RequestedDate", Request.RequestedDate); param[3] = new SqlParameter("@RequestedDate", System.Data.SqlDbType.Date, 50); param[3].Value =Convert.ToDateTime(Request.RequestedDate); param[4] = new SqlParameter("@RequestedTime", Request.RequestedTime); param[5] = new SqlParameter("@ApproverRemarks", Request.RequestRemarks); param[6] = new SqlParameter("@RequestType", Request.RequestType); // param[7] = new SqlParameter("@RouteName", Request.RouteName); param[7] = new SqlParameter("@BookingType", Request.BookingType); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
/// <summary> /// Method to insert RoleDetail /// </summary> /// <returns></returns> public Int32 InsertRole(RoleDetail roledetail) { ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] param = { new SqlParameter("@RoleName",SqlDbType.VarChar), new SqlParameter("@RoleAccess", SqlDbType.VarChar), new SqlParameter("@IsActive", SqlDbType.Bit), new SqlParameter("@CreatedBy", SqlDbType.VarChar), new SqlParameter("@Rval", SqlDbType.Int) }; param[0].Value = roledetail.RoleName; param[0].Size = 255; param[1].Value = roledetail.RoleAccess; param[1].Size = 155; param[2].Value = roledetail.IsActive; param[2].Size = 255; param[3].Value = roledetail.CreatedBy; param[3].Size = 155; param[4].Direction = ParameterDirection.ReturnValue; //string proc_name = ConstantsDLL.USP_INSERTROLE; //SqlParameter[] param = new SqlParameter[4]; //param[0] = new SqlParameter("@RoleName", roledetail.RoleName); //param[1] = new SqlParameter("@RoleAccess", roledetail.RoleAccess); //param[2] = new SqlParameter("@IsActive", roledetail.IsActive); //param[3] = new SqlParameter("@CreatedBy", roledetail.CreatedBy); //ObjSqlHelper.ExecNonQueryProc(proc_name, param); ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_INSERTROLE, param); return Convert.ToInt32(param[4].Value); }
/// <summary> /// Method to insert the details for creating new request /// </summary> /// <param name="vendor"></param> /// <returns></returns> public bool InsertRequest(OnDemandRequest request) { string proc_name = ConstantsDLL.USP_INSERTNEWREQUEST; SqlParameter[] param = new SqlParameter[15]; param[0] = new SqlParameter("@RequestType", request.RequestType); param[1] = new SqlParameter("@ReoccuringRequestId", request.ReoccuringRequest); param[2] = new SqlParameter("@ToDate", request.toDate); param[3] = new SqlParameter("@EmailId", request.EmailId); param[4] = new SqlParameter("@BookingType", request.BookingType); param[5] = new SqlParameter("@Gender", request.Gender); param[6] = new SqlParameter("@RouteId", request.RouteId); param[7] = new SqlParameter("@RequestedDate", request.RequestedDate); param[8] = new SqlParameter("@RequestedTime", System.Data.SqlDbType.Time,50); param[8].Value = request.RequestedTime; param[9] = new SqlParameter("@Address", request.Address); param[10] = new SqlParameter("@Mobile", request.Mobile); param[11] = new SqlParameter("@RequestRemarks", request.RequestRemarks); param[12] = new SqlParameter("@CreatedBy", request.CreatedBy); param[13] = new SqlParameter("@DCID", request.DCID); param[14] = new SqlParameter("@Approver", request.Approver); using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper()) { db.ExecNonQueryProc(proc_name, param); } return true; }
public Int32 UpdateRouteMaster(RouteMaster ObjRouteMaster) { ObjSqlHelper = new SqlHelper.SqlHelper(); SqlParameter[] oPara = { new SqlParameter("@DPID", SqlDbType.Int), new SqlParameter("@RouteName", SqlDbType.VarChar), new SqlParameter("@DropPoint", SqlDbType.VarChar), new SqlParameter("@SortOrder", SqlDbType.Int), new SqlParameter("@DCID",SqlDbType.Int), new SqlParameter("@CreatedBy", SqlDbType.VarChar), new SqlParameter("@Rval", SqlDbType.Int) }; oPara[0].Value = ObjRouteMaster.DPID; oPara[0].Size = 155; oPara[1].Value = ObjRouteMaster.RouteName.Trim(); oPara[1].Size = 155; oPara[2].Value = ObjRouteMaster.DropPoint.Trim(); oPara[2].Size = 255; oPara[3].Value = ObjRouteMaster.SortOrder; oPara[4].Value = ObjRouteMaster.DCID; oPara[4].Size = 255; oPara[5].Value = ObjRouteMaster.CreatedBy; oPara[5].Size = 255; oPara[6].Direction = ParameterDirection.ReturnValue; ObjSqlHelper.ExecNonQueryProc(ConstantsDLL.USP_UpdateRoute, oPara); return Convert.ToInt32(oPara[6].Value); }
/// <summary> /// Method to ActiveInactive RoleDetail /// </summary> /// <returns></returns> public bool UpdateRole(RoleDetail roledetail) { ObjSqlHelper = new SqlHelper.SqlHelper(); string proc_name = ConstantsDLL.USP_UPDATEROLE; SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@RoleId", roledetail.RoleId); param[1] = new SqlParameter("@IsActive", roledetail.IsActive); param[2] = new SqlParameter("@ModifyBy", roledetail.ModifiedBy); param[3] = new SqlParameter("@RoleName", roledetail.RoleName); param[4] = new SqlParameter("@RoleAccess", roledetail.RoleAccess); ObjSqlHelper.ExecNonQueryProc(proc_name, param); return true; }