protected void btnCheckOut_Click(object sender, EventArgs e) { try { string transid = ""; transid = insertReceived(txtSubTotal.Text, txtTax.Text, txtSHC.Text, txtMiscCost.Text, txttotal.Text); objPurchaseReceivedItemList = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItemList(); for (int i = 0; i < Gridview1.Rows.Count; i++) { objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem(); TextBox txtItemNames = (TextBox)Gridview1.Rows[i].FindControl("txtItemName"); if (txtItemNames.Text == "") { break; } TextBox txtDecs = (TextBox)Gridview1.Rows[i].FindControl("txtDec"); TextBox txtPrices = (TextBox)Gridview1.Rows[i].FindControl("txtPrice"); TextBox txtQuts = (TextBox)Gridview1.Rows[i].FindControl("txtQut"); TextBox txtTotals = (TextBox)Gridview1.Rows[i].FindControl("txtTotal"); objPurchaseReceivedItem.ItemPrefix = txtItemNames.Text; objPurchaseReceivedItem.Description = txtDecs.Text; objPurchaseReceivedItem.ItemPrice = Convert.ToDecimal(txtPrices.Text); objPurchaseReceivedItem.ItemUnit = txtQuts.Text; objPurchaseReceivedItem.TotalPrice = Convert.ToDecimal(txtTotals.Text); objPurchaseReceivedItem.PurchaseReceivedID = Convert.ToInt32(transid); objPurchaseReceivedItem.PurchaseOrderID = Convert.ToInt32(hfPOrder.Value); objPurchaseReceivedItemList.Add(objPurchaseReceivedItem); } oblPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessLogic.PurchaseReceivedItem(); objMessageInfo = oblPurchaseReceivedItem.ManageItemMaster(objPurchaseReceivedItemList, cmdMode); reset(); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(PReceived).FullName, 1); } }
protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e) { cmdMode = CommandMode.D; objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem(); oblPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessLogic.PurchaseReceivedItem(); try { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; objPurchaseReceivedItem.PurchaseItemReceivedID = Convert.ToInt32(dgvPurchaseItemReceived.DataKeys[gvrow.RowIndex].Value.ToString()); objPurchaseReceivedItem.PurchaseReceivedID = 0; objPurchaseReceivedItem.PurchaseOrderID = 0; objPurchaseReceivedItem.ItemID = 0; objPurchaseReceivedItem.ItemUnit = ""; objPurchaseReceivedItem.Description = ""; objPurchaseReceivedItem.ItemPrice = 0; objPurchaseReceivedItem.ClientID = 0; objPurchaseReceivedItem.CreatedBy = 1; objMessageInfo = oblPurchaseReceivedItem.ManageItemMaster(objPurchaseReceivedItem, cmdMode); BindPurchaseReceivedItem(); updatePurchasedItemReceivedBdInfo.Update(); } catch (Exception ex) { throw; } finally { objPurchaseReceivedItem = null; objMessageInfo = null; oblPurchaseReceivedItem = null; } }
public string insertItem(string name, string description, string unitprice, string quantity, string transId) { try { objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem(); objMessageInfo = new MessageInfo(); oblPurchaseReceived = new Store.PurchaseReceived.BusinessLogic.PurchaseReceived(); objPurchaseReceivedItem.PurchaseItemReceivedID = 0; objPurchaseReceivedItem.PurchaseOrderID = Convert.ToInt32(txtPoId.Text); objPurchaseReceivedItem.PurchaseReceivedID = Convert.ToInt32(transId); objPurchaseReceivedItem.ItemID = 0; objPurchaseReceivedItem.ItemPrefix = name; objPurchaseReceivedItem.ItemUnit = quantity; objPurchaseReceivedItem.Description = description; objPurchaseReceivedItem.ItemPrice = Convert.ToDecimal(unitprice); objPurchaseReceivedItem.IsActive = 1; objMessageInfo = oblPurchaseReceived.ManagePurchaseReceivedItem(objPurchaseReceivedItem, cmdMode); //objPurchaseOrder = new Store.PurchaseOrder.BusinessObject.PurchaseOrder(); return(""); } catch (Exception ex) {// Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(WebForm1).FullName, 1); } finally { objPurchaseReceivedItem = null; oblPurchaseReceived = null; objMessageInfo = null; } }
public Store.Common.MessageInfo ManagePurchaseReceivedItem(Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem objPurchaseReceivedItem, CommandMode cmdMode) { try { return(odlPurchaseReceived.ManagePurchaseReceivedItem(objPurchaseReceivedItem, cmdMode)); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(PurchaseReceived).FullName, 1); return(null); } }
void ManagePurchaseItemRecived() { objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem(); oblPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessLogic.PurchaseReceivedItem(); try { if (cmdMode == Store.Common.CommandMode.M) { objPurchaseReceivedItem.PurchaseItemReceivedID = Convert.ToInt32(txtPurchaseItemReceivedID.Text); } else { objPurchaseReceivedItem.PurchaseItemReceivedID = 0; } objPurchaseReceivedItem.PurchaseReceivedID = Convert.ToInt16(ddlPurchaseReceivedId.SelectedItem.Value); objPurchaseReceivedItem.PurchaseOrderID = Convert.ToInt16(ddlPurchaseOrderId.SelectedItem.Value); objPurchaseReceivedItem.ItemID = Convert.ToInt16(ddlItemId.SelectedItem.Value); objPurchaseReceivedItem.ItemUnit = Convert.ToString(txtItemUnit.Text); objPurchaseReceivedItem.Description = Convert.ToString(txtDescription.Text); objPurchaseReceivedItem.ItemPrice = Convert.ToDecimal(txtItemPrice.Text); if (chkBoxIsActive.Checked) { objPurchaseReceivedItem.IsActive = 1; } else { objPurchaseReceivedItem.IsActive = 0; } objPurchaseReceivedItem.CreatedBy = 1; objMessageInfo = oblPurchaseReceivedItem.ManageItemMaster(objPurchaseReceivedItem, cmdMode); } catch (Exception ex) { } finally { objPurchaseReceivedItem = null; //objMessageInfo = null; oblPurchaseReceivedItem = null; } }
public Store.Common.MessageInfo ManagePurchaseReceivedItem(Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem objPurchaseReceivedItem, CommandMode cmdMode) { string SQL = ""; ParameterList param = new ParameterList(); DataTableReader dr; Store.Common.MessageInfo objMessageInfo = null; try { SQL = "USP_ManagePurchaseReceived"; // SQL = "USP_ManagePurchaseReceivedItem"; param.Add(new SQLParameter("@PurchaseItemReceivedID", objPurchaseReceivedItem.PurchaseReceivedID)); param.Add(new SQLParameter("@PurchaseReceivedID", objPurchaseReceivedItem.PurchaseReceivedID)); param.Add(new SQLParameter("@PurchaseOrderID", objPurchaseReceivedItem.PurchaseOrderID)); param.Add(new SQLParameter("@ItemPrefix", objPurchaseReceivedItem.ItemPrefix)); param.Add(new SQLParameter("@ItemUnit", objPurchaseReceivedItem.ItemUnit)); param.Add(new SQLParameter("@Description", objPurchaseReceivedItem.Description)); param.Add(new SQLParameter("@ItemPrice", objPurchaseReceivedItem.ItemPrice)); param.Add(new SQLParameter("@IsActive", objPurchaseReceivedItem.IsActive)); param.Add(new SQLParameter("@ReferenceID", objPurchaseReceivedItem.ReferenceID)); param.Add(new SQLParameter("@UserId", objPurchaseReceivedItem.CreatedBy)); param.Add(new SQLParameter("@ClientID", objPurchaseReceivedItem.ClientID)); param.Add(new SQLParameter("@CMDMode", cmdMode)); dr = ExecuteQuery.ExecuteReader(SQL, param); if (dr.Read()) { objMessageInfo = new Store.Common.MessageInfo(); objMessageInfo.ErrorCode = Convert.ToInt32(dr["ErrorCode"]); objMessageInfo.ErrorMessage = Convert.ToString(dr["ErrorMessage"]); objMessageInfo.TranID = Convert.ToInt32(dr["TranID"]); objMessageInfo.TranCode = Convert.ToString(dr["TranCode"]); objMessageInfo.TranMessage = Convert.ToString(dr["TranMessage"]); } } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(PurchaseReceived).FullName, 1); } return(objMessageInfo); }
public static string insertda(string name, string description, string unitprice, string discountper, string discount, string quantity, string total) { Store.PurchaseReceivedItem.BusinessLogic.PurchaseReceivedItem oblPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessLogic.PurchaseReceivedItem(); Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem objPurchaseReceivedItem = new Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem(); Store.Common.MessageInfo objMessageInfo = new MessageInfo(); objPurchaseReceivedItem.PurchaseItemReceivedID = 0; objPurchaseReceivedItem.PurchaseReceivedID = 0; objPurchaseReceivedItem.PurchaseOrderID = 0; objPurchaseReceivedItem.ItemID = 0; objPurchaseReceivedItem.ItemPrefix = name; objPurchaseReceivedItem.ItemUnit = quantity; objPurchaseReceivedItem.Description = description; objPurchaseReceivedItem.ItemPrice = Convert.ToDecimal(unitprice); objPurchaseReceivedItem.TotalPrice = Convert.ToDecimal(total); objPurchaseReceivedItem.DiscountPre = Convert.ToDecimal(discountper); objPurchaseReceivedItem.Discount = Convert.ToDecimal(discount); objMessageInfo = oblPurchaseOrder.ManagePurchaseOrderMaster(objPurchaseOrderItem, 1); //objPurchaseOrder = new Store.PurchaseOrder.BusinessObject.PurchaseOrder(); return(""); }
public Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItemList GetAllPurchaseReceivedItemList(int PurchaseItemReceivedID, int Flag, string FlagValue) { Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItem objPurchaseReceivedItem = null; Store.PurchaseReceivedItem.BusinessObject.PurchaseReceivedItemList objPurchaseReceivedItemList = null; string SQL = string.Empty; ParameterList paramList = new ParameterList(); DataTableReader dr; try { SQL = "proc_PurchaseReceivedItem"; objPurchaseReceivedItemList = new BusinessObject.PurchaseReceivedItemList(); paramList.Add(new SQLParameter("@PurchaseItemReceivedID", PurchaseItemReceivedID)); paramList.Add(new SQLParameter("@Flag", Flag)); paramList.Add(new SQLParameter("@FlagValue", FlagValue)); dr = ExecuteQuery.ExecuteReader(SQL, paramList); while (dr.Read()) { objPurchaseReceivedItem = new BusinessObject.PurchaseReceivedItem(); if (dr.IsDBNull(dr.GetOrdinal("PurchaseItemReceivedID")) == false) { objPurchaseReceivedItem.PurchaseItemReceivedID = dr.GetInt32(dr.GetOrdinal("PurchaseItemReceivedID")); } if (dr.IsDBNull(dr.GetOrdinal("PurchaseOrderID")) == false) { objPurchaseReceivedItem.PurchaseOrderID = dr.GetInt32(dr.GetOrdinal("PurchaseOrderID")); } if (dr.IsDBNull(dr.GetOrdinal("PurchaseReceivedID")) == false) { objPurchaseReceivedItem.PurchaseReceivedID = dr.GetInt32(dr.GetOrdinal("PurchaseReceivedID")); } if (dr.IsDBNull(dr.GetOrdinal("ItemID")) == false) { objPurchaseReceivedItem.ItemID = dr.GetInt32(dr.GetOrdinal("ItemID")); } if (dr.IsDBNull(dr.GetOrdinal("ItemPrefix")) == false) { objPurchaseReceivedItem.ItemPrefix = dr.GetString(dr.GetOrdinal("ItemPrefix")); } if (dr.IsDBNull(dr.GetOrdinal("ItemUnit")) == false) { objPurchaseReceivedItem.ItemUnit = dr.GetString(dr.GetOrdinal("ItemUnit")); } if (dr.IsDBNull(dr.GetOrdinal("Description")) == false) { objPurchaseReceivedItem.Description = dr.GetString(dr.GetOrdinal("Description")); } if (dr.IsDBNull(dr.GetOrdinal("ItemPrice")) == false) { objPurchaseReceivedItem.ItemPrice = dr.GetDecimal(dr.GetOrdinal("ItemPrice")); } if (dr.IsDBNull(dr.GetOrdinal("ClientID")) == false) { objPurchaseReceivedItem.ClientID = dr.GetInt32(dr.GetOrdinal("ClientID")); } if (dr.IsDBNull(dr.GetOrdinal("CreatedBy")) == false) { objPurchaseReceivedItem.CreatedBy = dr.GetInt32(dr.GetOrdinal("CreatedBy")); } if (dr.IsDBNull(dr.GetOrdinal("CreatedOn")) == false) { objPurchaseReceivedItem.CreatedOn = dr.GetDateTime(dr.GetOrdinal("CreatedOn")); } if (dr.IsDBNull(dr.GetOrdinal("ModifiedBy")) == false) { objPurchaseReceivedItem.ModifiedBy = dr.GetInt32(dr.GetOrdinal("ModifiedBy")); } if (dr.IsDBNull(dr.GetOrdinal("ModifiedOn")) == false) { objPurchaseReceivedItem.ModifiedOn = dr.GetDateTime(dr.GetOrdinal("ModifiedOn")); } if (dr.IsDBNull(dr.GetOrdinal("ReferenceID")) == false) { objPurchaseReceivedItem.ReferenceID = dr.GetInt32(dr.GetOrdinal("ReferenceID")); } if (dr.IsDBNull(dr.GetOrdinal("IsActive")) == false) { objPurchaseReceivedItem.IsActive = dr.GetInt32(dr.GetOrdinal("IsActive")); } objPurchaseReceivedItemList.Add(objPurchaseReceivedItem); } dr.Close(); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(PurchaseReceivedItem).FullName, 1); } return(objPurchaseReceivedItemList); }