protected void btnAdd_Click(object sender, EventArgs e) { if (txtRecNo.Text == "") { msgBox1.alert("Please enter reciept number!"); txtRecNo.Focus(); return; } else if (txtPartNo.Text == "") { msgBox1.alert("Please enter Part No!"); txtPartNo.Focus(); return; } else if (txtProcby.Text == "") { msgBox1.alert("Please enter name of procurement officer!"); txtProcby.Focus(); return; } else if (RadRecDate.SelectedDate == null) { msgBox1.alert("Please reciept date!"); RadRecDate.Focus(); return; } else if (txtPartname.Text == "") { msgBox1.alert("Please enter part name!"); return; } else if (txtVendor.Text == "") { msgBox1.alert("Please enter vendor name"); return; } else if (txtform.Text == "") { txtform.Focus(); msgBox1.alert("Please select a tax form!"); return; } else if (cmbFlag.Text == "") { msgBox1.alert("Please select a flag!"); return; } else if (txtQtyRec.Text == "") { txtQtyRec.Focus(); msgBox1.alert("Please select quantity recieved!"); return; } else if (txtamt.Text == "") { txtamt.Focus(); msgBox1.alert("Please enter amount"); return; } else if (txtQty.Text == "") { txtQty.Focus(); msgBox1.alert("Please enter quantity!"); return; } qry = "UPDATE MRN SET procuredby = '" + txtProcby.Text.Trim() + "',Vendor = '" + txtVendor.Text.Trim() + "',RecieptNo = '" + txtRecNo.Text + "',Flag = '" + cmbFlag.Text + "',PartNo = '" + txtPartNo.Text.Trim() + "', Partname = '" + txtPartname.Text.Trim() + "', TaxForm = '" + txtform.Text.Trim() + "', Qty = '" + txtQty.Text + "', QtyRecieved ='" + txtQtyRec.Text + "', Amt ='" + txtamt.Text + "', RecieptDate = '" + String.Format("{0:MM/dd/yyyy}", RadRecDate.SelectedDate) + "' WHERE MRNNo=" + Convert.ToInt32(Session["MRNNo"].ToString()) + ""; con.SqlDs(qry, 2); Response.Redirect("MRNOrder.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { if (txtRecNo.Text == "") { msgBox1.alert("Please enter reciept number!"); txtRecNo.Focus(); return; } else if (txtPartNo.Text == "") { msgBox1.alert("Please enter part no!"); txtPartNo.Focus(); return; } else if (txtProcby.Text == "") { msgBox1.alert("Please enter name of procurement officer!"); txtProcby.Focus(); return; } else if (RadRecDate.SelectedDate == null) { msgBox1.alert("Please reciept date!"); RadRecDate.Focus(); return; } else if (txtPartname.Text == "") { msgBox1.alert("Please enter part name!"); return; } else if (txtVendor.Text == "") { msgBox1.alert("Please enter vendor name"); return; } else if (txtform.Text == "") { txtform.Focus(); msgBox1.alert("Please select a tax form!"); return; } else if (cmbFlag.Text == "") { msgBox1.alert("Please select a flag!"); return; } else if (txtQtyRec.Text == "") { txtQtyRec.Focus(); msgBox1.alert("Please select quantity recieved!"); return; } else if (txtamt.Text == "") { txtamt.Focus(); msgBox1.alert("Please enter amount"); return; } else if (txtQty.Text == "") { txtQty.Focus(); msgBox1.alert("Please enter quantity!"); return; } qry = "insert into MRN(Vendor,RecieptNo,Flag,PartNo,Partname,TaxForm,Qty,QtyRecieved,Amt,RecieptDate,procuredby) VALUES('" + txtVendor.Text.Trim() + "','" + txtRecNo.Text.Trim() + "','" + cmbFlag.Text + "','" + txtPartNo.Text.Trim() + "','" + txtPartname.Text.Trim() + "','" + txtform.Text.Trim() + "','" + txtQty.Text + "','" + txtQtyRec.Text + "','" + txtamt.Text + "','" + String.Format("{0:MM/dd/yyyy}", RadRecDate.SelectedDate) + "','" + txtProcby.Text.Trim() + "')"; con.SqlDs(qry, 2); grid1.DataSource = GetDataTablebydate(); grid1.DataBind(); clear(); }