protected void rpRequestOrderdetails_ItemCommand(object source, RepeaterCommandEventArgs e) { int TempID = 0; TempID = Convert.ToInt32(e.CommandArgument); switch (e.CommandName) { case ("delete"): { requestCart = new RequestCart(); purchaseData = new PurchaseData(); requestCart.RequestCartId = TempID; requestCart.Tokan = hftokanno.Value; requestCart.RequestBy = GlobalInfo.Userid; requestCart.Purpose = string.Empty; requestCart.Remark = string.Empty; requestCart.Specification = string.Empty; requestCart.Flag = 2; //2 for delete purchaseData.RequestCartDML(requestCart); bindCartList(requestCart); //RemoveTempID(TempID); //invocie.TokanId = hftokanno.Value; //invocie.UserID = GlobalInfo.Userid; //BindAgntTempItam(invocie); upMain.Update(); break; } } }
protected void btnAddItem_Click(object sender, EventArgs e) { requestCart = new RequestCart(); purchaseData = new PurchaseData(); requestCart.Tokan = hftokanno.Value; requestCart.RequestBy = GlobalInfo.Userid; requestCart.ItemId = Convert.ToInt32(dpItem.SelectedItem.Value); //requestCart.VendorId = Convert.ToInt32(dpVendor.SelectedItem.Value); requestCart.Quantity = string.IsNullOrEmpty(txtQuantity.Text) ? 0 : Convert.ToDecimal(txtQuantity.Text); requestCart.UnitId = Convert.ToInt32(dpUnit.SelectedItem.Value); requestCart.Specification = txtSpecification.Text; requestCart.Purpose = txtPurpose.Text; requestCart.Remark = txtRemark.Text; requestCart.Flag = 1; //1 for INSERT bool result = purchaseData.RequestCartDML(requestCart); if (result) { bindCartList(requestCart); } //dpSelect(); }