private void SavDet() { try { string ProQuot_id = ""; string cmds = "select max(cast(MProQuot_id as int)) as [MProQuot_id] from tbl_MProQuot"; SqlCommand cmd = new SqlCommand(cmds, con); con.Open(); DataTable dt_ = new DataTable(); SqlDataAdapter adp = new SqlDataAdapter(cmd); adp.Fill(dt_); { ProQuot_id = dt_.Rows[0]["MProQuot_id"].ToString(); } if (dt_.Rows.Count > 0) { foreach (GridViewRow g1 in GVDetQuot.Rows) { string DDLPro = (g1.FindControl("DDL_Pro") as DropDownList).SelectedValue; string TBProQty = (g1.FindControl("TBProQty") as TextBox).Text; string TBProrat = (g1.FindControl("TBProrat") as TextBox).Text; string TBAmt = (g1.FindControl("TBAmt") as TextBox).Text; string TBNarr = (g1.FindControl("TBNarr") as TextBox).Text; tbl_DProQuot dquot = new tbl_DProQuot(); dquot.DProQuot_id = HFDQuotID.Value; dquot.DProQuot_SNO = string.IsNullOrEmpty(TBProQty) ? null : TBProQty; dquot.ProductID = string.IsNullOrEmpty(DDLPro) ? null : DDLPro; dquot.DProQuot_rat = string.IsNullOrEmpty(TBProrat) ? null : TBProrat; dquot.MProQuot_amt = string.IsNullOrEmpty(TBAmt) ? null : TBAmt; dquot.MProQuot_tamt = string.IsNullOrEmpty(TBGrssTotal.Text.Trim()) ? null : TBGrssTotal.Text.Trim(); dquot.MProQuot_narr = string.IsNullOrEmpty(TBNarr) ? null : TBNarr; dquot.CreatedBy = Session["user"].ToString(); dquot.CreatedAt = DateTime.Now; dquot.ISActive = "1"; dquot.MProQuot_id = string.IsNullOrEmpty(ProQuot_id) ? null : ProQuot_id; tbl_DProQuotManager dproquotmanag = new tbl_DProQuotManager(dquot); dproquotmanag.Save(); } } else { lbl_err.Text = "Sory Record has not been Saved! Inner Error"; } con.Close(); } catch (Exception ex) { lbl_err.Text = ex.Message.ToString(); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } tbl_DProQuot DProQuot = obj as tbl_DProQuot; if (DProQuot == null) { return(false); } if (this.DProQuot_id == DProQuot.DProQuot_id) { return(true); } else { return(false); } }
public tbl_DProQuotManager(tbl_DProQuot _DProQuot) { DProQuot = _DProQuot; }