public bool IndentCartDML(IndentCart ic) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", ic.IndentCartId)); paramCollection.Add(new DBParameter("@Tokan", ic.Tokan)); paramCollection.Add(new DBParameter("@IndentBy", ic.IndentBy)); paramCollection.Add(new DBParameter("@ItemId", ic.ItemId)); paramCollection.Add(new DBParameter("@Quantity", ic.Quantity)); paramCollection.Add(new DBParameter("@Purpose", ic.Purpose)); paramCollection.Add(new DBParameter("@flag", ic.Flag)); result = _DBHelper.ExecuteNonQuery("SpPrchsIndentCart", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { string e = ex.ToString(); } if (result > 0) { return(true); } else { return(false); } }
protected void rpAgentOrderdetails_ItemCommand(object source, RepeaterCommandEventArgs e) { int TempID = 0; TempID = Convert.ToInt32(e.CommandArgument); switch (e.CommandName) { case ("delete"): { indentCart = new IndentCart(); purchaseData = new PurchaseData(); indentCart.IndentCartId = TempID; indentCart.Tokan = hftokanno.Value; indentCart.IndentBy = GlobalInfo.Userid; indentCart.Purpose = string.Empty; indentCart.Flag = 2; //2 for delete purchaseData.IndentCartDML(indentCart); bindCartList(indentCart); //RemoveTempID(TempID); //invocie.TokanId = hftokanno.Value; //invocie.UserID = GlobalInfo.Userid; //BindAgntTempItam(invocie); upMain.Update(); break; } } }
private void bindCartList(IndentCart ic) { purchaseData = new PurchaseData(); DS = new DataSet(); ic.Flag = 0; //Get Full List rpAgentOrderdetails.DataSource = purchaseData.GetIndentCartList(ic); rpAgentOrderdetails.DataBind(); }
public DataSet GetIndentCartList(IndentCart ic) { dbPurchase = new DBPurchase(); DS = new DataSet(); try { DS = dbPurchase.GetIndentCartList(ic); return(DS); } catch (Exception) { throw; } }
protected void btnAddItem_Click(object sender, EventArgs e) { indentCart = new IndentCart(); purchaseData = new PurchaseData(); indentCart.Tokan = hftokanno.Value; indentCart.IndentBy = GlobalInfo.Userid; indentCart.ItemId = Convert.ToInt32(dpItem.SelectedItem.Value); indentCart.Quantity = Convert.ToDecimal(txtQuantity.Text); indentCart.Purpose = txtPurpose.Text; indentCart.Flag = 1; //1 for INSERT bool result = purchaseData.IndentCartDML(indentCart); if (result) { bindCartList(indentCart); } dpSelect(); }
protected void btnSubmitIndent_Click(object sender, EventArgs e) { Indent indent = new Indent(); purchaseData = new PurchaseData(); IndentCart ic = new IndentCart(); indent.IndentByEmp = GlobalInfo.Userid; indent.IndentDate = DateTime.Now; // string temp = (Convert.ToDateTime(txtTillDate.Text)).ToString("dd-MM-yyyy"); indent.TillDate = (Convert.ToDateTime(txtTillDate.Text)).ToString("dd-MM-yyyy"); indent.Tokan = hftokanno.Value; ic.Tokan = hftokanno.Value; bool result = purchaseData.SubmitIndent(indent); if (result) { ic.Purpose = string.Empty; bindCartList(ic); clearFields(); divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; pnlError.Update(); upMain.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } dpSelect(); }
public DataSet GetIndentCartList(IndentCart ic) { DS = new DataSet(); try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", ic.IndentCartId)); paramCollection.Add(new DBParameter("@Tokan", ic.Tokan)); paramCollection.Add(new DBParameter("@IndentBy", ic.IndentBy)); paramCollection.Add(new DBParameter("@ItemId", ic.ItemId)); paramCollection.Add(new DBParameter("@Quantity", ic.Quantity)); paramCollection.Add(new DBParameter("@Purpose", ic.Purpose)); paramCollection.Add(new DBParameter("@flag", ic.Flag)); DS = _DBHelper.ExecuteDataSet("SpPrchsIndentCart", paramCollection, CommandType.StoredProcedure); } catch (Exception) { throw; } return(DS); }
public bool IndentCartDML(IndentCart ic) { dbPurchase = new DBPurchase(); return(dbPurchase.IndentCartDML(ic)); }