public List <ReorderInfo> SelectallReorderinfo() { try { List <ReorderInfo> lstinfo = new List <ReorderInfo>(); using (RMSDataContext db = new RMSDataContext()) { ReorderInfo rinfo; var a = (from o in db.Reorders select o).ToList(); foreach (var obj in a) { rinfo = new ReorderInfo(); rinfo.ReorderID = obj.ReorderID; rinfo.ProductID = obj.ProductID; rinfo.InventoryID = obj.InventoryID; rinfo.ReorderUnit = obj.ReorderUnit; lstinfo.Add(rinfo); } return(lstinfo); } } catch (Exception ex) { return(new List <ReorderInfo>()); } }
private void BuildSortingBuffer() { this._originalNodesInOrder = this._buffer.ToArray(); this._buffer.Clear(); this._sortingInfoArray = new ReorderInfo[this._originalNodesInOrder.Length]; int num = 0; ReorderInfo info = new ReorderInfo(); for (int i = 0; i < this._originalNodesInOrder.Length; i++) { info.Depth = num; info.OriginalOrderIndex = i; info.XamlNodeType = this._originalNodesInOrder[i].NodeType; switch (info.XamlNodeType) { case XamlNodeType.StartObject: case XamlNodeType.GetObject: info.Depth = ++num; break; case XamlNodeType.EndObject: info.Depth = num--; break; } this._sortingInfoArray[i] = info; } }
private void SwapRanges(int beginning, int middle, int end) { int length = middle - beginning; int num2 = end - middle; ReorderInfo[] destinationArray = new ReorderInfo[length]; Array.Copy(this._sortingInfoArray, beginning, destinationArray, 0, length); Array.Copy(this._sortingInfoArray, middle, this._sortingInfoArray, beginning, num2); Array.Copy(destinationArray, 0, this._sortingInfoArray, beginning + num2, length); }
protected void btnSaveReorder_Click(object sender, EventArgs e) { ReorderInfo Reoinfo = new ReorderInfo(); Reoinfo.ReorderID = txtProductID.Text; Reoinfo.InventoryID = txtInventoryID.Text; Reoinfo.ReorderUnit = txtReorderUnit.Text; // ReorderController Reocontroller = new ReorderController(); Reocontroller.InsertReorder(Reoinfo); gridviewcall(); }
public void DeleteReorderByReorderID(ReorderInfo Reoinfo) { try { using (RMSDataContext db = new RMSDataContext()) { var obj = (from a in db.Reorders where a.ReorderID == Reoinfo.ReorderID select a).First(); { db.Reorders.DeleteOnSubmit(obj); db.SubmitChanges(); } } } catch (Exception ex) { Reorder Reo = new Reorder(); } }
public void InsertReorder(ReorderInfo rinfo) { try { using (RMSDataContext db = new RMSDataContext()) { Reorder reo = new Reorder(); Guid rid = Guid.NewGuid(); reo.ReorderID = rid.ToString(); reo.InventoryID = rinfo.InventoryID; reo.ProductID = rinfo.ProductID; reo.ReorderUnit = rinfo.ReorderUnit; db.Reorders.InsertOnSubmit(reo); db.SubmitChanges(); } } catch (Exception ex) { } }
public void UpdateReorderByReorderID(ReorderInfo Reoinfo) { try { using (RMSDataContext db = new RMSDataContext()) { var obj = (from a in db.Reorders where a.ReorderID == Reoinfo.ReorderID select a).First(); { obj.ReorderID = Reoinfo.ReorderID; obj.ProductID = Reoinfo.ProductID; obj.InventoryID = Reoinfo.InventoryID; obj.ReorderUnit = Reoinfo.ReorderUnit; db.SubmitChanges(); } } } catch (Exception ex) { Reorder Reo = new Reorder(); } }
private void SwapRanges(int beginning, int middle, int end) { int length1 = middle - beginning; int length2 = end - middle; Debug.Assert(length1 > 0 && length2 > 0); ReorderInfo[] temp = new ReorderInfo[length1]; // Copy first half into temp storage. // srcArray, srcIdx, destArray, destIdx, length Array.Copy(_sortingInfoArray, beginning, temp, 0, length1); // Copy second half up where the first half was. // srcArray, srcIdx, destArray, destIdx, length Array.Copy(_sortingInfoArray, middle, _sortingInfoArray, beginning, length2); // Copy first half out of temp storage in after the first half // srcArray, srcIdx, destArray, destIdx, length Array.Copy(temp, 0, _sortingInfoArray, beginning + length2, length1); }
private void BuildSortingBuffer() { _originalNodesInOrder = _buffer.ToArray(); _buffer.Clear(); // Build an array with the info we need _sortingInfoArray = new ReorderInfo[_originalNodesInOrder.Length]; int depth = 0; ReorderInfo rInfo = new ReorderInfo(); for (int i = 0; i < _originalNodesInOrder.Length; i++) { rInfo.Depth = depth; rInfo.OriginalOrderIndex = i; rInfo.XamlNodeType = _originalNodesInOrder[i].NodeType; switch (rInfo.XamlNodeType) { case XamlNodeType.NamespaceDeclaration: case XamlNodeType.EndMember: case XamlNodeType.Value: break; case XamlNodeType.GetObject: case XamlNodeType.StartObject: rInfo.Depth = ++depth; break; case XamlNodeType.EndObject: rInfo.Depth = depth--; break; case XamlNodeType.StartMember: break; } _sortingInfoArray[i] = rInfo; } }
public void DeleteReorder(ReorderInfo Reoinfo) { Reodao.DeleteReorderByReorderID(Reoinfo); }
public void UpdateReorder(ReorderInfo Reoinfo) { Reodao.UpdateReorderByReorderID(Reoinfo); }
public void InsertReorder(ReorderInfo Reoinfo) { Reodao.InsertReorder(Reoinfo); }
protected void btnSave_Click(object sender, EventArgs e) { Productinfo prinfo = new Productinfo(); ProductController pcon = new ProductController(); prinfo.ProductName = txtProductName.Text.Trim(); prinfo.Product_description = txtDesc.Text.Trim(); prinfo.Color = txtColor.Text.Trim(); prinfo.Size = txtSize.Text.Trim(); prinfo.Manufacture_Country = txtMade.Text.Trim(); prinfo.UnitPrice = Convert.ToDecimal(txtSellPrice.Text.Trim()); prinfo.Manufacture_date = Convert.ToDateTime(txtManuDate.Text.Trim()); prinfo.Expired_date = Convert.ToDateTime(txtExpDate.Text.Trim()); prinfo.Product_Expired_date = Convert.ToDateTime(txtExpDate.Text.Trim()); prinfo.BrandID = ddlBrand.SelectedItem.Value; prinfo.CategoryID = ddlCateogry.SelectedItem.Value; prinfo.SupplierID = ddlSupplier.SelectedItem.Value; prinfo.UMID = ddlUM.SelectedItem.Value; //pcon.InsertProduct(prinfo); string productID = pcon.InsertProduct(prinfo); Inventoryinfo invinfo = new Inventoryinfo(); Invertorycontroller invCon = new Invertorycontroller(); invinfo.ProductID = productID; invinfo.UnitInStock = Convert.ToInt32(txtUnitStock.Text.Trim()); string invId = invCon.InsertInventory(invinfo); ReorderInfo rinfo = new ReorderInfo(); ReorderController rcon = new ReorderController(); rinfo.ProductID = productID; rinfo.InventoryID = invId; rinfo.ReorderUnit = txtReorder.Text.Trim(); rcon.InsertReorder(rinfo); Cell_Priceinfoinfo cinfo = new Cell_Priceinfoinfo(); Cell_PriceController ccon = new Cell_PriceController(); cinfo.Cell_Price1 = Convert.ToDecimal(txtBuyPrice.Text.Trim()); cinfo.Cell_Price2 = Convert.ToDecimal(txtSellPrice.Text.Trim()); cinfo.Product_id = productID; cinfo.UMID = ddlUM.SelectedItem.Value; ccon.InsertCell_Price(cinfo); if (fuMain.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuMain.FileBytes; piminfo.MainPic = true; pimcon.InsertProductImage(piminfo); } if (fuLeft.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuLeft.FileBytes; pimcon.InsertProductImage(piminfo); } if (FuBehind.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = FuBehind.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuRight.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuRight.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuFront.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuFront.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuBottom.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuBottom.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('New Product Inserted Successfully!')", true); }