public vendor Delete_vendor_select(int ID) { vendor = vendor.Select(ID); Delete_vendor_id_txt_lbl.Text = Convert.ToString(vendor.vendor_id); Delete_vendor_name_txt_lbl.Text = Convert.ToString(vendor.vendor_name); Delete_phone_num_txt_lbl.Text = Convert.ToString(vendor.phone_num); Delete_email_txt_lbl.Text = Convert.ToString(vendor.email); Delete_address_id_txt_lbl.Text = Convert.ToString(vendor.address_id); Delete_Vendor_address2_txt_lbl.Text = Convert.ToString(vendor.Vendor_address2); Delete_vendor_job_assign_txt_lbl.Text = Convert.ToString(vendor.vendor_job_assign); Delete_vendor_start_date_txt_lbl.Text = Convert.ToString(vendor.vendor_start_date); Delete_vendor_end_date_txt_lbl.Text = Convert.ToString(vendor.vendor_end_date); Delete_vendor_meth_of_contact_txt_lbl.Text = Convert.ToString(vendor.vendor_meth_of_contact); Delete_vendor_status_txt_lbl.Text = Convert.ToString(vendor.vendor_status); Delete_vendor_meth_of_pay_txt_lbl.Text = Convert.ToString(vendor.vendor_meth_of_pay); Delete_vendor_type_txt_lbl.Text = Convert.ToString(vendor.vendor_type); Delete_vendor_comments_txt_lbl.Text = Convert.ToString(vendor.vendor_comments); Delete_primary_fName_txt_lbl.Text = Convert.ToString(vendor.primary_fName); Delete_primary_lName_txt_lbl.Text = Convert.ToString(vendor.primary_lName); Delete_primary_phone_txt_lbl.Text = Convert.ToString(vendor.primary_phone); Delete_sec_fName_txt_lbl.Text = Convert.ToString(vendor.sec_fName); Delete_sec_lName_txt_lbl.Text = Convert.ToString(vendor.sec_lName); Delete_sec_phone_txt_lbl.Text = Convert.ToString(vendor.sec_phone); return vendor; }
public string Create(vendor Model) { DatabaseContext db = new DatabaseContext(); string msg; try { if (ModelState.IsValid) { Model.idVendor = new Random().Next(1, 1000); db.vendor.Add(Model); db.SaveChanges(); msg = "Saved Successfully"; } else { msg = "Validation data not successfully"; } } catch (Exception ex) { msg = "Error occured:" + ex.Message; } return(msg); }
public vendor vendor_update(int ID) { vendor = vendor.Select(ID); vendor.vendor_id = Convert.ToInt32(Update_vendor_id_txt.Text); vendor.vendor_name = Update_vendor_name_txt.Text; vendor.phone_num = Update_phone_num_txt.Text; vendor.email = Update_email_txt.Text; vendor.address_id = Convert.ToInt32(Update_address_id_txt.Text); vendor.Vendor_address2 = Convert.ToInt32(Update_Vendor_address2_txt.Text); vendor.vendor_job_assign = Update_vendor_job_assign_txt.Text; vendor.vendor_start_date = Convert.ToDateTime(Update_vendor_start_date_txt.Text); vendor.vendor_end_date = Convert.ToDateTime(Update_vendor_end_date_txt.Text); vendor.vendor_meth_of_contact = Update_vendor_meth_of_contact_txt.Text; vendor.vendor_status = Update_vendor_status_txt.Text; vendor.vendor_meth_of_pay = Update_vendor_meth_of_pay_txt.Text; vendor.vendor_type = Update_vendor_type_txt.Text; vendor.vendor_comments = Update_vendor_comments_txt.Text; vendor.primary_fName = Update_primary_fName_txt.Text; vendor.primary_lName = Update_primary_lName_txt.Text; vendor.primary_phone = Update_primary_phone_txt.Text; vendor.sec_fName = Update_sec_fName_txt.Text; vendor.sec_lName = Update_sec_lName_txt.Text; vendor.sec_phone = Update_sec_phone_txt.Text; vendor.Update(vendor); Insert_vendor_GridView.DataBind(); Update_vendor_GridView.DataBind(); Delete_vendor_GridView.DataBind(); return(vendor); }
public vendor Delete_vendor_select(int ID) { vendor = vendor.Select(ID); Delete_vendor_id_txt_lbl.Text = Convert.ToString(vendor.vendor_id); Delete_vendor_name_txt_lbl.Text = Convert.ToString(vendor.vendor_name); Delete_phone_num_txt_lbl.Text = Convert.ToString(vendor.phone_num); Delete_email_txt_lbl.Text = Convert.ToString(vendor.email); Delete_address_id_txt_lbl.Text = Convert.ToString(vendor.address_id); Delete_Vendor_address2_txt_lbl.Text = Convert.ToString(vendor.Vendor_address2); Delete_vendor_job_assign_txt_lbl.Text = Convert.ToString(vendor.vendor_job_assign); Delete_vendor_start_date_txt_lbl.Text = Convert.ToString(vendor.vendor_start_date); Delete_vendor_end_date_txt_lbl.Text = Convert.ToString(vendor.vendor_end_date); Delete_vendor_meth_of_contact_txt_lbl.Text = Convert.ToString(vendor.vendor_meth_of_contact); Delete_vendor_status_txt_lbl.Text = Convert.ToString(vendor.vendor_status); Delete_vendor_meth_of_pay_txt_lbl.Text = Convert.ToString(vendor.vendor_meth_of_pay); Delete_vendor_type_txt_lbl.Text = Convert.ToString(vendor.vendor_type); Delete_vendor_comments_txt_lbl.Text = Convert.ToString(vendor.vendor_comments); Delete_primary_fName_txt_lbl.Text = Convert.ToString(vendor.primary_fName); Delete_primary_lName_txt_lbl.Text = Convert.ToString(vendor.primary_lName); Delete_primary_phone_txt_lbl.Text = Convert.ToString(vendor.primary_phone); Delete_sec_fName_txt_lbl.Text = Convert.ToString(vendor.sec_fName); Delete_sec_lName_txt_lbl.Text = Convert.ToString(vendor.sec_lName); Delete_sec_phone_txt_lbl.Text = Convert.ToString(vendor.sec_phone); return(vendor); }
private FileInfo GetUploadedFile(vendor vendor) { var filePath = Directory.GetFiles(vendor.FilePath).FirstOrDefault(m => m.Contains(vendor.FileName)); if (filePath != null) { var file = new FileInfo(filePath); if (!String.IsNullOrEmpty(file.Name)) { if (String.Equals(vendor.FileType, FileType.CSV.ToString(), StringComparison.OrdinalIgnoreCase)) { if (String.Equals(file.Extension, ".csv", StringComparison.CurrentCultureIgnoreCase)) { return(file); } } else if (String.Equals(vendor.FileType, FileType.Excel.ToString(), StringComparison.OrdinalIgnoreCase)) { if (String.Equals(file.Extension, ".xls", StringComparison.CurrentCultureIgnoreCase) || String.Equals(file.Extension, ".xlsx", StringComparison.CurrentCultureIgnoreCase)) { return(file); } } } } return(null); }
public async Task <vendor> InsertVendor(vendor vendor) { _context.Vendor.Add(vendor); var result = await _context.SaveChangesAsync(); return(vendor); }
public ActionResult Create([Bind(Include = "vendorId,name,address,TPIN_PAN,karDataNo,email,altEmail,phone,mobilePhone,url,contactPerson,bankName,bankBranch,bankAccNo")] vendor vendor) { if (ModelState.IsValid) { vendor objVendor = new vendor(); objVendor.name = TrimText(vendor.name); objVendor.address = TrimText(vendor.address); objVendor.TPIN_PAN = TrimText(vendor.TPIN_PAN); objVendor.karDataNo = TrimText(vendor.karDataNo); objVendor.email = vendor.email; objVendor.altEmail = vendor.altEmail; objVendor.phone = TrimText(vendor.phone); objVendor.mobilePhone = TrimText(vendor.mobilePhone); objVendor.url = TrimText(vendor.url); objVendor.contactPerson = TrimText(vendor.contactPerson); objVendor.bankName = TrimText(vendor.bankName); objVendor.bankBranch = TrimText(vendor.bankBranch); objVendor.bankAccNo = TrimText(vendor.bankAccNo); db.vendors.Add(objVendor); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vendor)); }
public IHttpActionResult Putvendor(int id, vendor vendor) { //if (!ModelState.IsValid) //{ // return BadRequest(ModelState); //} if (id != vendor.vd_id) { return(BadRequest()); } db.Entry(vendor).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!vendorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
void obj_onDataSaved(object Sender, DataSaveargs e) { vendor c = (vendor)e.data; combobox_supplier.addItem(c, c.id); combobox_supplier.selectByValue(c.id); }
public int postVendor(vendor vendor) { //if (!ModelState.IsValid) //{ // return BadRequest(ModelState); //} //db.vendors.Add(vendor); //db.SaveChanges(); //return CreatedAtRoute("DefaultApi", new { id = vendor.vd_id }, vendor); vendor vd = new vendor(); vd = db.vendors.Where(x => x.vd_name == vendor.vd_name && x.vd_atype_id == vendor.vd_atype_id).FirstOrDefault(); if (vd == null) { db.vendors.Add(vendor); db.SaveChanges(); return(1); } else { return(0); } }
public void Index(vendor a) { try { SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["EcommerceCon"].ConnectionString; if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "pSMWVendorReg"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@name", SqlDbType.VarChar).Value = a.name; cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = a.email; cmd.Parameters.Add("@password", SqlDbType.VarChar).Value = a.password; cmd.Parameters.Add("@contact", SqlDbType.VarChar).Value = a.contact; cmd.Parameters.Add("@address", SqlDbType.VarChar).Value = a.address; cmd.Parameters.Add("@state", SqlDbType.VarChar).Value = a.state; cmd.Parameters.Add("@city", SqlDbType.VarChar).Value = a.city; cmd.Parameters.Add("@pincode", SqlDbType.VarChar).Value = a.pincode; cmd.ExecuteNonQuery(); con.Close(); } catch (Exception e) { } }
public ActionResult setVendor(vendor a) { TempData["email"] = a.email; TempData["password"] = a.password; TempData.Keep(); return(View()); }
public int Index(vendor obj) { int flag = 0; try { SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["EcommerceCon"].ConnectionString; if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "pSMWVendorSignIn"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = obj.email; cmd.Parameters.Add("@password", SqlDbType.VarChar).Value = obj.password; flag = Convert.ToInt16(cmd.ExecuteScalar()); con.Close(); } catch (Exception e) { return(0); } return(flag); }
public async Task <int> UpdatePatch(JsonPatchDocument <UpdatePatchDTO> state, int id) { var ven = _repository.GetByIdVender(id); var dto = new UpdatePatchDTO() { VendorName = ven.VendorName, Title = ven.Title, PhoneNumber = ven.PhoneNumber, Address = ven.Address }; state.ApplyTo(dto); var vendor = new vendor() { Id = id, VendorName = dto.VendorName, Title = dto.Title, PhoneNumber = dto.PhoneNumber, Address = dto.Address }; return(await _repository.UpdateVendor(vendor)); }
protected void btxoa_Click(object sender, EventArgs e) { if (txtID.Text != "") { int n = 0; if (int.TryParse(this.txtID.Text, out n)) { if (bao_bus.checkIDVendor(Int32.Parse(txtID.Text))) { vendor v = new vendor(); v.VendorID = Int32.Parse(txtID.Text); bao_bus.deleteVendor(v.VendorID); Response.Write("<script>alert('Xóa thành công!')</script>"); load(); } else { Response.Write("<script>alert('ID là số nguyên')</script>"); } } else { Response.Write("<script>alert('Không có mã này rồi!')</script>"); } } else { Response.Write("<script>alert('Điền ID để xóa!')</script>"); } }
public ActionResult DeleteConfirmed(int id) { vendor vendor = db.vendors.Find(id); db.vendors.Remove(vendor); db.SaveChanges(); return(RedirectToAction("Index")); }
public string Delete(string Id) { DatabaseContext db = new DatabaseContext(); vendor vendors = db.vendor.Find(int.Parse(Id)); db.vendor.Remove(vendors); db.SaveChanges(); return("Deleted successfully"); }
public ActionResult Create(vendorModel user) { using (var context = new promoLacDbEntities()) { { vendor info = new vendor() { firstName = user.firstName, lastName = user.lastName, vendorEmail = user.vendorEmail, vendorPassword = user.vendorPassword, registerTimestamp = DateTime.Now, phoneNumber = user.phoneNumber, vendorUserName = user.vendorUserName, headId = vendorId(User.Identity.Name), isHead = "N", vendorStatus = "A", vendorAddress = vendorAddress(vendorId(User.Identity.Name)), vendorCompanyName = vendorCompanyName(vendorId(User.Identity.Name)) }; context.vendors.Add(info); context.SaveChanges(); var result = context.userPackages.Where(x => x.vendorId == info.headId).FirstOrDefault(); userPackage u = new userPackage(); u.vendorId = vendorId(user.vendorUserName); u.packageStartTime = result.packageStartTime; u.packageEndTime = result.packageEndTime; u.packageId = result.packageId; u.dividedShareOfMessages = user.messagesAllowed; u.packageStatus = "active"; u.notificationSent = 0; u.remainingFencingHours = user.fencingHours; context.userPackages.Add(u); context.SaveChanges(); foreach (var x in user.areas) { areaAssigned ar = new areaAssigned() { vendorId = vendorId(user.vendorUserName), areaId = Convert.ToInt32(x) }; context.areaAssigneds.Add(ar); context.SaveChanges(); } var result1 = context.userPackages.Where(x => x.vendorId == info.headId).FirstOrDefault(); result1.dividedShareOfMessages = result1.dividedShareOfMessages - user.messagesAllowed; result1.remainingFencingHours = result1.remainingFencingHours - user.fencingHours; context.SaveChanges(); } return(RedirectToAction("../ControlPanel/ControlPanel")); } }
public ActionResult Edit([Bind(Include = "vend_id")] vendor vendor) { if (ModelState.IsValid) { db.Entry(vendor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vendor)); }
public ActionResult edit_vendor(vendor vendor) { var ven = db_certs.vendors.First(v => v.id == vendor.id); ven.name = vendor.name; ven.foundationDate = vendor.foundationDate; ven.address = vendor.address; db_certs.SaveChanges(); return(RedirectToAction("vendor_management", "Home")); }
public ActionResult Create([Bind(Include = "vend_id")] vendor vendor) { if (ModelState.IsValid) { db.vendors.Add(vendor); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vendor)); }
public void update(vendor ven) { id = ven.id; name = ven.name; address = ven.adress; email = ven.email; phone = ven.phoneno; pannumber = ven.panno; due = ven.due.Value; advance = ven.advance.Value; }
public Payword() { InitializeComponent(); dredeem = new d_redemption(redemption); Vendor = new vendor(); Vendor.setUIfront(Vtextbox); Vendor.setfref(this); Broker = new broker(); Broker.setUIfront(Btextbox); }
public IHttpActionResult Getvendor(int id) { vendor vendor = db.vendors.Find(id); if (vendor == null) { return(NotFound()); } return(Ok(vendor)); }
private void label2_Click(object sender, EventArgs e) { if (venname_txt.Text.Trim() == "") { notificationMAnager1.show("please fill the name", 1000); return; } if (venaddr_txt.Text.Trim() == "") { notificationMAnager1.show("please fill the address", 1000); return; } if (venphn_txt.Text == "") { notificationMAnager1.show("please fill the phone", 1000); return; } try { vendor ven = new vendor { name = venname_txt.Text, adress = venaddr_txt.Text, panno = pannum_txt.Text, email = vanemail_txt.Text, phoneno = venphn_txt.Text, vatno = vatnum_txt.Text, advance = Convert.ToDecimal(vanadvnc_txt.Text), due = Convert.ToDecimal(vendue_txt.Text), created_at = DateTime.Now, updated_at = DateTime.Now }; db.vendors.Add(ven); db.SaveChanges(); if (onDataSaved != null) { onDataSaved(this, new DataSaveargs() { data = ven }); } notificationMAnager1.show("data are successfully saved", 1000); this.Close(); }catch (Exception ex) { notificationMAnager1.show("data are is not save please try again", 1000); this.Close(); } }
public IHttpActionResult Deletevendor(int id) { vendor vendor = db.vendors.Find(id); if (vendor == null) { return(NotFound()); } db.vendors.Remove(vendor); db.SaveChanges(); return(Ok(vendor)); }
// GET: /Vendor/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } vendor vendor = db.vendors.Find(id); if (vendor == null) { return(HttpNotFound()); } return(View(vendor)); }
public VenViwer(vendor vendor) { for (int i = 0; i <= 10; i++) { SubItems.Add(new ListViewSubItem()); } id = vendor.id; name = vendor.name; address = vendor.adress; email = vendor.email; phone = vendor.phoneno; pannumber = vendor.panno; due = vendor.due.Value; advance = vendor.advance.Value; }
public void loaddata(int id) { vendor a = db.vendors.Where(o => o.id == id).First(); venname_txt.Text = a.name; venaddr_txt.Text = a.adress; pannum_txt.Text = a.panno; vanemail_txt.Text = a.email; vatnum_txt.Text = a.vatno; venphn_txt.Text = a.phoneno; vendue_txt.Text = a.due.ToString(); vanadvnc_txt.Text = a.advance.ToString(); this.id = id; }
public static IFileReader GetFileReader(FileInfo file, vendor vendor) { if (vendor.FileType == Excel) { return(new ExcelReader(file, vendor)); } else if (vendor.FileType == CSV) { var reader = new CsvReader(file, vendor); reader.SetDelimiter(';'); return(reader); } return(null); }
public ActionResult CertViewFull(int id) { certificate certificate = db_certs.certificates.First(c => c.id == id); owner owner = db_certs.owners.First(o => o.id == certificate.ownerID); vendor vendor = db_certs.vendors.First(v => v.id == certificate.vendorID); ViewBag.certificate = certificate; ViewBag.owner = owner; ViewBag.vendor = vendor; ViewBag.img1 = @"~/Files/" + certificate.file1_name; ViewBag.img2 = @"~/Files/" + certificate.file2_name; ViewBag.img3 = @"~/Files/" + certificate.file3_name; ViewBag.img4 = @"~/Files/" + certificate.file4_name; return(View()); }
public vendor vendor_update(int ID) { vendor = vendor.Select(ID); vendor.vendor_id = Convert.ToInt32(Update_vendor_id_txt.Text); vendor.vendor_name = Update_vendor_name_txt.Text; vendor.phone_num = Update_phone_num_txt.Text; vendor.email = Update_email_txt.Text; vendor.address_id = Convert.ToInt32(Update_address_id_txt.Text); vendor.Vendor_address2 = Convert.ToInt32(Update_Vendor_address2_txt.Text); vendor.vendor_job_assign = Update_vendor_job_assign_txt.Text; vendor.vendor_start_date = Convert.ToDateTime(Update_vendor_start_date_txt.Text); vendor.vendor_end_date = Convert.ToDateTime(Update_vendor_end_date_txt.Text); vendor.vendor_meth_of_contact = Update_vendor_meth_of_contact_txt.Text; vendor.vendor_status = Update_vendor_status_txt.Text; vendor.vendor_meth_of_pay = Update_vendor_meth_of_pay_txt.Text; vendor.vendor_type = Update_vendor_type_txt.Text; vendor.vendor_comments = Update_vendor_comments_txt.Text; vendor.primary_fName = Update_primary_fName_txt.Text; vendor.primary_lName = Update_primary_lName_txt.Text; vendor.primary_phone = Update_primary_phone_txt.Text; vendor.sec_fName = Update_sec_fName_txt.Text; vendor.sec_lName = Update_sec_lName_txt.Text; vendor.sec_phone = Update_sec_phone_txt.Text; vendor.Update(vendor); Insert_vendor_GridView.DataBind(); Update_vendor_GridView.DataBind(); Delete_vendor_GridView.DataBind(); return vendor; }
protected void Insert_Select_Record(object sender, EventArgs e) { vendor = Insert_vendor_select(Convert.ToInt32(Insert_vendor_GridView.SelectedValue)); }
protected void UPDATE(object sender, EventArgs e) { vendor = vendor_update(Convert.ToInt32(Update_vendor_GridView.SelectedValue)); }
protected void Update_Select_Record(object sender, EventArgs e) { vendor = Update_vendor_select(Convert.ToInt32(Update_vendor_GridView.SelectedValue)); }
protected void INSERT(object sender, EventArgs e) { vendor = vendor_insert(); }