/// <summary> /// Add Transporter /// </summary> /// <returns>return Status</returns> public static int AddTransporter(Transporter transporter) { int result; string transNo = ""; TMSDataLibrary.Transporter _objtransporter = new TMSDataLibrary.Transporter(); int usertype = (int)CONSTANT.ApplicationUserType.Transporter; result = _objtransporter.AddTranporter(transporter.Password, transporter.TransportName, transporter.FirstName, transporter.LastName, transporter.Mobile, transporter.Email, transporter.AddressLine, transporter.Pincode, transporter.CityId, usertype, transporter.ProfilePhoto, out transNo); transporter.TransporterNo = transNo; return result; }
/// <summary> /// Get Transporter Info using UserId /// </summary> /// <param name="userid">User Id</param> /// <returns>Transporter</returns> public static Transporter GetTransporterInfo(int userid) { DataTable dt = new DataTable(); Transporter transporter = new Transporter(); TMSDataLibrary.Transporter _transporterdata = new TMSDataLibrary.Transporter(); dt = _transporterdata.GetTransporterInfo(userid); if (dt.Rows.Count > 0) { transporter.TransporterId = (int)dt.Rows[0][CONSTS.TransporterColumnIndex.TransporterId]; transporter.UserId = (int)dt.Rows[0][CONSTS.TransporterColumnIndex.UserId]; transporter.TransportName = dt.Rows[0][CONSTS.TransporterColumnIndex.Transportname].ToString(); transporter.FirstName = dt.Rows[0][CONSTS.TransporterColumnIndex.FirstName].ToString(); transporter.LastName = dt.Rows[0][CONSTS.TransporterColumnIndex.LastName].ToString(); transporter.Mobile = dt.Rows[0][CONSTS.TransporterColumnIndex.Mobile].ToString(); transporter.Email = dt.Rows[0][CONSTS.TransporterColumnIndex.Email].ToString(); transporter.AddressLine = dt.Rows[0][CONSTS.TransporterColumnIndex.AddressLine].ToString(); transporter.Pincode = dt.Rows[0][CONSTS.TransporterColumnIndex.Pincode].ToString(); transporter.CityId = Convert.ToInt32(dt.Rows[0][CONSTS.TransporterColumnIndex.CityId]); transporter.CityName = dt.Rows[0][CONSTS.TransporterColumnIndex.CityName].ToString(); if (dt.Rows[0][CONSTS.TransporterColumnIndex.ProfilePhoto].ToString() != "") { transporter.ProfilePhoto = dt.Rows[0][CONSTS.TransporterColumnIndex.ProfilePhoto].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.AltContactNo].ToString() != "") { transporter.AltContactName = dt.Rows[0][CONSTS.TransporterColumnIndex.AltContactNo].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.AltMobileNo].ToString() != "") { transporter.AltMobileNo = dt.Rows[0][CONSTS.TransporterColumnIndex.AltMobileNo].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.StdCode].ToString() != "") { transporter.StdCode = Convert.ToDecimal(dt.Rows[0][CONSTS.TransporterColumnIndex.StdCode]); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.LandlineNo].ToString() != "") { transporter.LandlineNo = Convert.ToDecimal(dt.Rows[0][CONSTS.TransporterColumnIndex.LandlineNo]); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.Fax].ToString() != "") { transporter.Fax = Convert.ToDecimal(dt.Rows[0][CONSTS.TransporterColumnIndex.Fax]); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.ServiceTaxNo].ToString() != "") { transporter.ServiceTaxNo = dt.Rows[0][CONSTS.TransporterColumnIndex.ServiceTaxNo].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.PanNumber].ToString() != "") { transporter.PanNumber = dt.Rows[0][CONSTS.TransporterColumnIndex.PanNumber].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.Franchise].ToString() != "") { var teamp = dt.Rows[0][CONSTS.TransporterColumnIndex.Franchise]; transporter.Franchise = Convert.ToInt32(dt.Rows[0][CONSTS.TransporterColumnIndex.Franchise]); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.EstablishYear].ToString() != "") { transporter.EstablishYear = dt.Rows[0][CONSTS.TransporterColumnIndex.EstablishYear].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.Website].ToString() != "") { transporter.Website = dt.Rows[0][CONSTS.TransporterColumnIndex.Website].ToString(); } if (dt.Rows[0][CONSTS.TransporterColumnIndex.UpdatedAt].ToString() != "") { transporter.UpdatedAt = (DateTime)dt.Rows[0][CONSTS.TransporterColumnIndex.UpdatedAt]; } transporter.TransporterNo = (String)dt.Rows[0][CONSTS.TransporterColumnIndex.TransporterNo]; } return transporter; }
public DataTable GetTransporter(string query) { TMSDataLibrary.Transporter _transporter = new TMSDataLibrary.Transporter(); return _transporter.GetTransporter(query); }
/// <summary> /// Update Transporter Information /// </summary> /// <param name="transporter">object of Transporter class</param> /// <returns>No of Updated Row</returns> public static int UpdateTransporter(Transporter transporter) { int result; TMSDataLibrary.Transporter _objtransporter = new TMSDataLibrary.Transporter(); result = _objtransporter.UpdateTransporter(transporter.AddressLine, transporter.Pincode, transporter.ProfilePhoto, transporter.AltContactName, transporter.AltMobileNo, transporter.ServiceTaxNo, transporter.PanNumber, transporter.EstablishYear, transporter.Website, transporter.StdCode, transporter.LandlineNo, transporter.Fax, transporter.Franchise, transporter.CityId, transporter.UserId); return result; }
/// <summary> /// Gets all the transporter's to be filled in DropDownList /// </summary> /// <returns></returns> public static List<Transporter> GetTransportersForDropDown() { var lstTransporters = new List<Transporter>(); var oTransporter = new TMSDataLibrary.Transporter(); var dt = oTransporter.GetTransportersForDropDown(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { lstTransporters.Add(new Transporter() { TransporterId = Convert.ToInt32(dt.Rows[i][CONSTS.TransporterColumnIndex.TransporterId]), TransportName = dt.Rows[i]["TransportName"].ToString() }); } } return lstTransporters; }
public static object GetTransporterList(string transporterName, string mobileNo, string transporterNo) { var oTransporter = new TMSDataLibrary.Transporter(); return oTransporter.GetTransporterList(transporterName, mobileNo, transporterNo); }
/// <summary> /// Get Transporter List /// </summary> /// <param name="userid"></param> /// <returns>datatable of TransporterList</returns> public static DataTable GetTransporterList(string TransportName, int CityId, int vehicleTypeId) { TMSDataLibrary.Transporter Transporter = new TMSDataLibrary.Transporter(); return Transporter.GetTransporterList(TransportName, CityId, vehicleTypeId); }
/// <summary> /// Get All Transporter /// </summary> /// <returns>datatable of Transporter</returns> public static DataTable GetTransporterInfo() { TMSDataLibrary.Transporter transporter = new TMSDataLibrary.Transporter(); return transporter.GetTransporterInfo(); }