示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string invids = Session["invids"].ToString();


        DataTable dt = new InventoryLogic().selectForPrint(invids);

        Repeater1.DataSource = dt;
        Repeater1.DataBind();

        int    c = 0;
        String s = "";

        foreach (DataRow row in dt.Rows)
        {
            if (c == 0)
            {
                s = row["SupplierName"].ToString();
                c++;
            }
            else
            {
                if (!row["SupplierName"].ToString().Equals(s))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Multiple customer can not have same quotation.')", true);
                    Response.Redirect("InventoryList.aspx");
                }
                c++;
            }
        }

        TextBox2.Text = dt.Rows[0]["SupplierName"].ToString();
    }
示例#2
0
    protected void btnUpload_OnClick(object sender, EventArgs e)
    {
        string invids = Session["invids"].ToString();

        string[]         arr = invids.Split(',');
        InventoryLogic   il  = new InventoryLogic();
        RawMaterialLogic rl  = new RawMaterialLogic();
        GRNLogic         gl  = new GRNLogic();
        GRN g = new GRN();

        g.SupplierID = rl.SelectByID(il.SelectByID(Convert.ToInt32(arr[0])).RawMaterialID).SupplierID;
        string    path;
        string    ticks = DateTime.Now.Ticks.ToString();
        Inventory inv;

        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("Images/" + ticks + FileUpload1.FileName));
            path      = "Images/" + ticks + FileUpload1.FileName;
            g.GRNPath = path;
            int id = gl.Insert(g);

            for (int i = 0; i < arr.Length; i++)
            {
                inv       = il.SelectByID(Convert.ToInt32(arr[i]));
                inv.GRNID = id;
                il.Update(inv);
                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage" + arr[i], "alert(" + arr[i] + ")", true);
            }
        }
        // Response.Redirect("QuotationList.aspx");
        Response.Redirect("InventoryList.aspx");
    }
        protected void BtnAddRequest_Click(object sender, EventArgs e)
        {
            Button                    btnAddRequest = sender as Button;
            GridViewRow               row           = btnAddRequest.NamingContainer as GridViewRow;
            string                    itemId        = GridViewAddRequest.DataKeys[row.RowIndex].Values[0].ToString();
            InventoryCatalogue        item          = InventoryLogic.GetInventoryItem(itemId);
            List <InventoryCatalogue> cartList;

            if (Session["CartList"] != null)
            {
                cartList = (List <InventoryCatalogue>)Session["CartList"];
                bool Exist = cartList.Any(x => x.ItemID == itemId);
                if (Exist)
                {
                    LblCount.Text      = "You cannot request same item twice.";
                    LblCount.ForeColor = Color.Red;
                    return;
                }
                else
                {
                    cartList.Add(item);
                    Session["CartList"] = cartList;
                    Response.Redirect("~/DepartmentEmployee/ViewCatalogue.aspx");
                }
            }

            else
            {
                cartList = new List <InventoryCatalogue>();
                cartList.Add(item);
                Session["CartList"] = cartList;
                Response.Redirect("~/DepartmentEmployee/ViewCatalogue.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            InventoryLogic i = new InventoryLogic();

            if (!IsPostBack)
            {
//-------loading the dropdown list with catagoryName--------------------------------------------------------------------//

                cList = InventoryLogic.GetCatalogue();
                CatalogueCategory cat = new CatalogueCategory();
                cat.CatalogueName = "All";
                cat.CategoryID    = "All";
                cList.Add(cat);

                DdlCatagory.DataTextField  = "CatalogueName";
                DdlCatagory.DataValueField = "CatalogueName";

                DdlCatagory.DataSource = cList;
                DdlCatagory.DataBind();
                ControlVisibleFalse();

//-----------------Loads all inventory items when the page loads for the first time------------------------------------//
                GridBind();
                DdlCatagory.SelectedValue = "All";
            }
        }
示例#5
0
 protected void TxtItemCode_TextChanged(object sender, EventArgs e)
 {
     statusMessage.Visible = false;
     try
     {
         GridViewRow        currentRow    = (GridViewRow)((TextBox)sender).Parent.Parent.Parent.Parent;
         TextBox            txtItemCode   = currentRow.FindControl("TxtItemCode") as TextBox;
         InventoryCatalogue inventoryItem = InventoryLogic.GetInventoryItem(txtItemCode.Text);
         string             itemName      = inventoryItem.Description;
         string             uom           = inventoryItem.UOM;
         Label lblDesc = currentRow.FindControl("LblDesc") as Label;
         Label lblUOM  = currentRow.FindControl("LblUOM") as Label;
         if (lblDesc != null)
         {
             lblDesc.Text = itemName;
         }
         if (lblUOM != null)
         {
             lblUOM.Text = uom;
         }
     }catch (Exception ex)
     {
         statusMessage.ForeColor = Color.Red;
         statusMessage.Text      = "Invalid Item Code Entered: ";
         Console.WriteLine(ex.ToString());
         statusMessage.Visible = true;
     }
 }
        private static bool ExecuteSellAllItems(SPInventoryVM __instance, ref InventoryLogic ____inventoryLogic, ref CharacterObject ____currentCharacter)
        {
            var golds    = 0;
            var leftGold = __instance.LeftInventoryOwnerGold;

            __instance.IsRefreshed = false;
            for (int i = __instance.RightItemListVM.Count - 1; i >= 0; i--)
            {
                SPItemVM spitemVM = __instance.RightItemListVM[i];
                if (spitemVM != null && !spitemVM.IsFiltered && !spitemVM.IsLocked)
                {
                    golds += spitemVM.ItemCost * spitemVM.ItemRosterElement.Amount;
                    if (__instance.IsTrading && golds > leftGold)
                    {
                        break;
                    }
                    TransferCommand command = TransferCommand.Transfer(spitemVM.ItemRosterElement.Amount, InventoryLogic.InventorySide.PlayerInventory, InventoryLogic.InventorySide.OtherInventory, spitemVM.ItemRosterElement, EquipmentIndex.None, EquipmentIndex.None, ____currentCharacter, !__instance.IsInWarSet);
                    ____inventoryLogic.AddTransferCommand(command);
                }
            }
            Traverse.Create(__instance).Method("RefreshInformationValues").GetValue();
            Traverse.Create(__instance).Method("ExecuteRemoveZeroCounts").GetValue();
            __instance.IsRefreshed = true;

            return(false);
        }
        protected void Txtitemid_TextChanged(object sender, EventArgs e)
        {
            try
            {
                GridViewRow currentRow = (GridViewRow)((TextBox)sender).Parent.Parent.Parent.Parent;
                TextBox     Txtitemid  = currentRow.FindControl("Txtitemid") as TextBox;
                inventoryItem = InventoryLogic.GetItemName(Txtitemid.Text);
                string  ItemID      = Txtitemid.Text;
                string  UOM         = PurchasingLogic.GetUOM(ItemID, DdlSli.SelectedValue);
                double  unitPrice   = PurchasingLogic.GetUnitPrice(ItemID, DdlSli.SelectedValue);
                TextBox TxtQuantity = currentRow.FindControl("TxtQuantity") as TextBox;
                int     quantity;

                Label DesLbl = currentRow.FindControl("LblDes") as Label;
                DesLbl.Text = inventoryItem;
                Label UnpLbl = currentRow.FindControl("LblUnp") as Label;
                UnpLbl.Text = PurchasingLogic.GetUnitPrice(ItemID, DdlSli.SelectedValue).ToString("C");
                Label LblUOM = currentRow.FindControl("LblUOM") as Label;
                LblUOM.Text = PurchasingLogic.GetUOM(ItemID, DdlSli.SelectedValue);

                if (int.TryParse(TxtQuantity.Text, out quantity))
                {
                    Label LblPrice = currentRow.FindControl("LblPrice") as Label;
                    LblPrice.Text = (quantity * unitPrice).ToString("c");
                    total        += (quantity * unitPrice);
                }
            }
            catch
            {
                statusMessage.Text    = "Some items entered are not provided by this supplier.";
                statusMessage.Visible = true;
            }
        }
    protected void btnUpload_OnClick(object sender, EventArgs e)
    {

        string invids = Session["invids"].ToString();
        string[] arr = invids.Split(',');
        InventoryLogic il = new InventoryLogic();
        RawMaterialLogic rl = new RawMaterialLogic();
        GRNLogic gl = new GRNLogic();
        GRN g = new GRN();
        g.SupplierID = rl.SelectByID(il.SelectByID(Convert.ToInt32(arr[0])).RawMaterialID).SupplierID;
        string path;
        string ticks = DateTime.Now.Ticks.ToString();
        Inventory inv;
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("Images/" + ticks + FileUpload1.FileName));
            path = "Images/" + ticks + FileUpload1.FileName;
            g.GRNPath = path;
            int id =  gl.Insert(g);
            
            for (int i = 0; i < arr.Length; i++)
            {
                inv = il.SelectByID(Convert.ToInt32(arr[i]));
                inv.GRNID = id;
                il.Update(inv);
                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage" + arr[i], "alert(" + arr[i] + ")", true);
            }

        }
        // Response.Redirect("QuotationList.aspx");
        Response.Redirect("InventoryList.aspx");

    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string invids = Session["invids"].ToString();


        DataTable dt = new InventoryLogic().selectForPrint(invids);
        Repeater1.DataSource = dt;
        Repeater1.DataBind();

        int c = 0;
        String s = "";
        foreach (DataRow row in dt.Rows)
        {

            if (c == 0)
            {
                s = row["SupplierName"].ToString();
                c++;
            }
            else
            {
                if (!row["SupplierName"].ToString().Equals(s))
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Multiple customer can not have same quotation.')", true);
                    Response.Redirect("InventoryList.aspx");
                }
                c++;
            }
        }

        TextBox2.Text = dt.Rows[0]["SupplierName"].ToString();
    }
示例#10
0
        private static void AfterTransfer(SPInventoryVM __instance, InventoryLogic inventoryLogic, List <TransferCommandResult> results)
        {
            if (!CommonSetting.Instance.LockNoMiss)
            {
                return;
            }


            Func <EquipmentElement, ItemRosterElement, bool> func = delegate(EquipmentElement x, ItemRosterElement itemRosterElement)
            {
                if (x.Item.StringId == itemRosterElement.EquipmentElement.Item.StringId)
                {
                    ItemModifier itemModifier  = x.ItemModifier;
                    string       a             = (itemModifier != null) ? itemModifier.StringId : null;
                    ItemModifier itemModifier2 = itemRosterElement.EquipmentElement.ItemModifier;
                    return(a == ((itemModifier2 != null) ? itemModifier2.StringId : null));
                }
                return(false);
            };

            List <EquipmentElement> list = Campaign.Current.GetCampaignBehavior <IInventoryLockTracker>().GetLocks().ToList();

            foreach (SPItemVM spitemVM in __instance.RightItemListVM)
            {
                if (list.Exists(a => func(a, spitemVM.ItemRosterElement)))
                {
                    spitemVM.IsLocked = true;
                }
            }
        }
示例#11
0
        static void PurchaseOrderIsApproved(int poNumber)
        {
            PORecord po;
            double   totalPrice = 0;
            string   supplierEmail;

            using (SA45Team12AD ctx = new SA45Team12AD())
            {
                po            = ctx.PORecords.Where(x => x.PONumber == poNumber).FirstOrDefault();
                supplierEmail = ctx.SupplierLists.Where(x => x.SupplierID == po.SupplierID).Select(x => x.EmailAddress).FirstOrDefault();
                List <PORecordDetail> poDList = ctx.PORecordDetails.Where(x => x.PONumber == poNumber).ToList();
                foreach (PORecordDetail p in poDList)
                {
                    InventoryLogic.UpdateUnitsOnOrder(p.ItemID, (int)p.Quantity);
                    totalPrice += (double)(p.UnitPrice * p.Quantity);
                }
            }
            //Creating a thread to send the PDF email in background to prevent lagging the Website.
            Thread bgThread = new Thread(delegate()
            {
                using (EmailControl em = new EmailControl())
                {
                    em.SendPurchaseOrder(supplierEmail, po.PONumber, po.RecipientName, po.DeliveryAddress, GetSuppilerName(po.SupplierID), (DateTime)po.ExpectedDelivery, totalPrice);
                }
            });

            bgThread.Start();
        }
示例#12
0
 void Awake()
 {
     _toolImage      = gameObject.transform.GetChild(0).GetComponent <Image>();
     _inventory      = GameObject.FindGameObjectWithTag("Inventory").GetComponent <InventoryLogic>();
     _invenRender    = GameObject.FindGameObjectWithTag("Inventory").GetComponent <InventoryRenderer>();
     _descriptionBox = GameObject.FindGameObjectWithTag("DescriptionBox").GetComponent <Text>();
 }
        protected void Button1_Click(object sender, EventArgs e)
        {
            statusMessage.Visible = false;
            string   itemCode = TxtItemCode.Text;
            DateTime startDate;
            DateTime endDate;

            try
            {
                startDate = DateTime.ParseExact(Request.Form["datepickerStart"], "dd/MM/yyyy", CultureInfo.InvariantCulture);
                endDate   = DateTime.ParseExact(Request.Form["datepickerEnd"], "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            catch (Exception)
            {
                //DateParsing Exception..
                statusMessage.Text      = "Date Error. Please enter a valid date in dd/MM/yyyy format.";
                statusMessage.ForeColor = System.Drawing.Color.Red;
                statusMessage.Visible   = true;
                return;
            }
            SA45Team12ADDataSet.StoreOrderHistoryDataTable dt = new SA45Team12ADDataSet.StoreOrderHistoryDataTable();
            SA45Team12ADDataSetTableAdapters.StoreOrderHistoryTableAdapter ta = new SA45Team12ADDataSetTableAdapters.StoreOrderHistoryTableAdapter();
            SA45Team12ADDataSet ds = new SA45Team12ADDataSet();

            if (DdlSupplier.SelectedValue == "All")
            {
                ta.Fill(dt, startDate, endDate, itemCode, "*");
            }
            else
            {
                foreach (GridViewRow r in GridViewSupplier.Rows)
                {
                    string supplierId = (r.FindControl("LblSupplierID") as Label).Text;
                    dt.Merge(ta.GetData(startDate, endDate, itemCode, supplierId));
                }
            }

            ReportParameter startDateParam = new ReportParameter("StartDate", startDate.ToString("d"));
            ReportParameter endDateParam   = new ReportParameter("EndDate", endDate.ToString("d"));
            ReportParameter itemDescParam;

            try
            {
                itemDescParam = new ReportParameter("ItemDescription", InventoryLogic.GetItemName(itemCode));
            }
            catch (Exception)
            {
                statusMessage.Text      = "Invalid Item Code Entered.";
                statusMessage.ForeColor = System.Drawing.Color.Red;
                statusMessage.Visible   = true;
                return;
            }
            ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { startDateParam, endDateParam, itemDescParam });
            ReportDataSource dataSource = new ReportDataSource("SA45Team12ADDataSet", (DataTable)dt);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(dataSource);
            ReportViewer1.LocalReport.Refresh();
            ReportViewer1.Visible = true;
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        InventoryLogic il = new InventoryLogic();
        DateTime       d1 = new DateTime();
        DateTime       d2 = new DateTime();

        if (!DateTime.TryParseExact(TextBox1.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
        {
            d1 = DateTime.Now.AddYears(-100);
        }

        if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d2))
        {
            d2 = DateTime.Now.AddYears(+10);
        }


        DataTable dt = il.Search(d1, d2, Convert.ToInt32(DropDownList1.SelectedItem.Value));

        Repeater1.DataSource = dt;
        Repeater1.DataBind();
        if (dt.Rows.Count == 0)
        {
            Table1.Visible = false;
            Label3.Visible = true;
        }
        else
        {
            Table1.Visible = true;
            Label3.Visible = false;
        }
    }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt6 = new InventoryLogic().SelectRawStock();

        Repeater1.DataSource = dt6;
        Repeater1.DataBind();
    }
        protected void FindBtn_Click(object sender, EventArgs e)
        {
            string itemcode = TxtItemCode.Text;
            int    bufferstocklevel;

            LblItemCode.Text = itemcode;
            try
            {
                InventoryCatalogue i = InventoryLogic.GetInventoryItem(itemcode);
                bufferstocklevel = PurchasingLogic.GetCurrentBufferStock(itemcode);
                if (bufferstocklevel >= 0)
                {
                    AutomationStatusLbl.Text = "The current buffer stock level is " + bufferstocklevel + ".";
                }
                else
                {
                    AutomationStatusLbl.Text = "The buffer stock level is currently calculated automatically.";
                }
                LblItemDescription.Text    = i.Description;
                MultiView1.ActiveViewIndex = 1;
                statusMessage.Visible      = false;
            }
            catch
            {
                statusMessage.Text      = "Item does not exist.";
                statusMessage.Visible   = true;
                statusMessage.ForeColor = Color.Red;
            }
        }
示例#17
0
        protected void TxtAdjQty_TextChanged(object sender, EventArgs e)
        {
            statusMessage.Visible = false;

            GridViewRow currentRow  = (GridViewRow)((TextBox)sender).Parent.Parent.Parent.Parent;
            TextBox     txtItemCode = currentRow.FindControl("TxtItemCode") as TextBox;
            TextBox     txtAdjQty   = currentRow.FindControl("TxtAdjQty") as TextBox;
            int         AdjQty;
            bool        isInteger = int.TryParse(txtAdjQty.Text, out AdjQty);

            if (!isInteger)
            {
                statusMessage.Text      = "Invalid Quantity.";
                statusMessage.ForeColor = Color.Red;
                statusMessage.Visible   = true;
                return;
            }
            string adjValue = (InventoryLogic.GetInventoryPrice(txtItemCode.Text) * AdjQty).ToString("c");

            Label LblValue = currentRow.FindControl("LblValue") as Label;

            if (LblValue != null)
            {
                LblValue.Text = adjValue;
            }
        }
示例#18
0
        protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow && ((AVRequestDetail)e.Row.DataItem).ItemID != null)
            {
                AVRequestDetail avR      = (AVRequestDetail)e.Row.DataItem;
                string          itemId   = avR.ItemID;
                string          itemName = InventoryLogic.GetItemName(itemId);
                string          adjValue = ((double)(InventoryLogic.GetInventoryPrice(itemId) * avR.Quantity)).ToString("c");

                Label LblDesc = (e.Row.FindControl("LblDesc") as Label);
                if (LblDesc != null)
                {
                    LblDesc.Text = itemName;
                }
                Label LblValue = (e.Row.FindControl("LblValue") as Label);
                if (LblValue != null)
                {
                    LblValue.Text = adjValue;
                }
                DropDownList DdlType = (e.Row.FindControl("DdlAdjType") as DropDownList);
                if (DdlType != null)
                {
                    DdlType.Text = avR.Type;
                }
            }
        }
示例#19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE"))
        {
            InventoryLogic   iil = new InventoryLogic();
            Inventory        c1  = iil.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
            RawMaterialLogic rrl = new RawMaterialLogic();
            RawMaterial      r1  = rrl.SelectByID(c1.RawMaterialID);

            if (c1 != null)
            {
                Label1.Text = r1.Name;
                Label2.Text = c1.Quantity.ToString();
                Label3.Text = c1.TrDate.ToString();
                Label4.Text = c1.Remarks;
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
示例#20
0
        public List <WCF_InventoryCatalogue> SearchInventoryList(string query, string token)
        {
            //Check if user is authorizated to use this method. If is not authorized, it will return a json with -1 in the primary key
            if (!IsAuthanticateUser(token))
            {
                List <WCF_InventoryCatalogue> wcf_UnAuthObj = new List <WCF_InventoryCatalogue>();
                WCF_InventoryCatalogue        wcfUnAuth     = new WCF_InventoryCatalogue();
                wcfUnAuth.ItemID = "-1";
                wcf_UnAuthObj.Add(wcfUnAuth);
                return(wcf_UnAuthObj);
            }
            InventoryLogic                inventoryLogic = new InventoryLogic();
            List <InventoryCatalogue>     catalogueList  = inventoryLogic.SearchBy(query);
            List <WCF_InventoryCatalogue> wcfList        = new List <WCF_InventoryCatalogue>();

            foreach (InventoryCatalogue i in catalogueList)
            {
                WCF_InventoryCatalogue w = WCF_InventoryCatalogue.Create(i.ItemID, i.BIN, i.Shelf, (int)i.Level,
                                                                         i.CategoryID, i.Description, (int)i.ReorderLevel, i.UnitsInStock,
                                                                         (int)i.ReorderQty, i.UOM, i.Discontinued, (int)i.UnitsOnOrder,
                                                                         (int)i.BufferStockLevel);
                wcfList.Add(w);
            }
            return(wcfList);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE"))
        {
            InventoryLogic iil = new InventoryLogic();
            Inventory c1 = iil.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
            RawMaterialLogic rrl = new RawMaterialLogic();
            RawMaterial r1 = rrl.SelectByID(c1.RawMaterialID);

            if (c1 != null)
            {

                Label1.Text = r1.Name;
                Label2.Text = c1.Quantity.ToString();
                Label3.Text = c1.TrDate.ToString();
                Label4.Text = c1.Remarks;

            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {

            InventoryLogic il = new InventoryLogic();
            Inventory objInventory = il.SelectByID(Convert.ToInt32(Request.QueryString["ID"]));

            objInventory.RawMaterialID = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            objInventory.Quantity = Convert.ToInt32(TextBox1.Text);
            //objInventory.TrDate = Convert.ToDateTime(TextBox2.Text);
            DateTime d1 = new DateTime();
            if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
            {
                objInventory.TrDate = DateTime.Now;
            }
            if (d1.ToShortDateString().Equals(DateTime.Today.ToShortDateString()))
            {
                objInventory.TrDate = DateTime.Now;
            }
            else
            {
                objInventory.TrDate = d1;
            }
            objInventory.Remarks = TextBox3.Text;
            objInventory.EmployeeID = Convert.ToInt32(Session["EmployeeID"]);
            objInventory.GRNID = 0;
            il.Update(objInventory);
            Response.Redirect("InventoryList.aspx");
        }
        else
        {
            InventoryLogic il = new InventoryLogic();
            Inventory objInventory = new Inventory();

            objInventory.RawMaterialID = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            objInventory.Quantity = Convert.ToInt32(TextBox1.Text);
            //objInventory.TrDate = Convert.ToDateTime(TextBox2.Text);
            DateTime d1 = new DateTime();
            if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
            {
                objInventory.TrDate = DateTime.Today;
            }
            if (d1.ToShortDateString().Equals(DateTime.Today.ToShortDateString()))
            {
                objInventory.TrDate = DateTime.Now;
            }
            else
            {
                objInventory.TrDate = d1;
            }
            
            objInventory.Remarks = TextBox3.Text;
            objInventory.EmployeeID = Convert.ToInt32(Session["EmployeeID"]);
            objInventory.GRNID = 0;
            il.Insert(objInventory);

            Response.Redirect("InventoryList.aspx");
        }
    }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                tempListDetails = InventoryLogic.GetRelevantDetailList();
                List <InventoryCatalogue> tempListItems = InventoryLogic.GetRelevantItemList(tempListDetails);


                // Bind data to the list
                GridViewMainList.DataSource = tempListItems;
                GridViewMainList.DataBind();

                // If there are zero retrieved items from the DB
                if (tempListItems == null || tempListItems.Count == 0)
                {
                    TbxResult.Visible           = false;
                    BtnCumulativeSubmit.Visible = false;
                }
            }


            // Populating our message
            if (Session["RetrievalListMessage"] != null)
            {
                TbxResult.Visible = true;
                TbxResult.Text    = (string)Session["RetrievalListMessage"];
                Session["RetrievalListMessage"] = null;   // This resets the session.
            }
        }
示例#24
0
 void Awake()
 {
     inventoryData = this.gameObject.GetComponent<InventoryData>();
     inventoryLogic = this.gameObject.GetComponent<InventoryLogic>();
     playerData = GameObject.Find("Player").GetComponent<PlayerData>();
     playerLogic = GameObject.Find("Player").GetComponent<PlayerLogic>();
 }
示例#25
0
        public List <WCF_StockCard> GetStockCard(string itemId, string token)
        {
            //Check if user is authorizated to use this method. If is not authorized, it will return a json with -1 in the primary key
            if (!IsAuthanticateUser(token))
            {
                List <WCF_StockCard> wcf_UnAuthObj = new List <WCF_StockCard>();
                WCF_StockCard        wcfUnAuth     = new WCF_StockCard();
                wcfUnAuth.ID = -1;
                wcf_UnAuthObj.Add(wcfUnAuth);
                return(wcf_UnAuthObj);
            }
            InventoryLogic       inventoryLogic = new InventoryLogic();
            List <StockCard>     stockCard      = InventoryLogic.GetStockcardByItemId(itemId);
            List <WCF_StockCard> wcfList        = new List <WCF_StockCard>();

            foreach (StockCard i in stockCard)
            {
                WCF_InventoryCatalogue c = SearchInventoryList(i.ItemID, internalSecertKey).First();
                WCF_StockCard          w = WCF_StockCard.Create(i.ID, i.ItemID,
                                                                ((DateTime)i.Date).ToString("d"), i.Description, i.Type,
                                                                (int)i.Quantity, i.UOM, (int)i.Balance, c);
                wcfList.Add(w);
            }
            return(wcfList);
        }
示例#26
0
        protected string GetPendingAVR()
        {
            int supervisor_count = 0;
            int manager_count    = 0;

            List <AVRequest> pendingList = InventoryLogic.GetListOfAdjustmentRequests("Pending");

            foreach (AVRequest a in pendingList)
            {
                if (a.HandledBy == "Supervisor")
                {
                    supervisor_count++;
                }
                if (a.HandledBy == "Manager")
                {
                    manager_count++;
                }
            }

            if (User.IsInRole("Supervisor"))
            {
                return(supervisor_count.ToString());
            }
            if (User.IsInRole("Manager"))
            {
                return(manager_count.ToString());
            }
            return("0");
        }
        private void RetrieveDisbursementData()
        {
            List <CollectionPoint> pointList = DisbursementLogic.ListCollectionPoints();
            int collectionId = DisbursementLogic.GetListofDepartments().Where(x => x.DeptID == DdlDept.SelectedValue).Select(x => x.CollectionPointID).FirstOrDefault();

            LblCollectPoint.Text = pointList.Where(x => x.CollectionPointID == collectionId).Select(x => x.CollectionPoint1).FirstOrDefault();
            LblDeptRep.Text      = DisbursementLogic.GetDeptRepFullName(DdlDept.SelectedValue);

            string deptId = DdlDept.SelectedValue;
            List <InventoryRetrievalList> rList = InventoryLogic.GetListOfInventoryRetrival(deptId);

            if (rList.Count > 0)
            {
                GridViewDisbList.DataSource = rList;
                GridViewDisbList.DataBind();

                GridViewDisbList.Visible = true;
                BtnCreateDis.Visible     = true;

                statusMessage.Text = string.Empty;
            }
            else
            {
                GridViewDisbList.Visible = false;
                BtnCreateDis.Visible     = false;
                statusMessage.ForeColor  = Color.Red;
                statusMessage.Text       = "No Disbursement Found for " + DdlDept.SelectedItem;
            }
        }
 public void PerformPurpose(InventoryLogic inventory)
 {
     if (CanOpen)
     {
         StartCoroutine(Open());
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            InventoryLogic il           = new InventoryLogic();
            Inventory      objInventory = il.SelectByID(Convert.ToInt32(Request.QueryString["ID"]));

            objInventory.RawMaterialID = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            objInventory.Quantity      = Convert.ToInt32(TextBox1.Text);
            //objInventory.TrDate = Convert.ToDateTime(TextBox2.Text);
            DateTime d1 = new DateTime();
            if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
            {
                objInventory.TrDate = DateTime.Now;
            }
            if (d1.ToShortDateString().Equals(DateTime.Today.ToShortDateString()))
            {
                objInventory.TrDate = DateTime.Now;
            }
            else
            {
                objInventory.TrDate = d1;
            }
            objInventory.Remarks    = TextBox3.Text;
            objInventory.EmployeeID = Convert.ToInt32(Session["EmployeeID"]);
            objInventory.GRNID      = 0;
            il.Update(objInventory);
            Response.Redirect("InventoryList.aspx");
        }
        else
        {
            InventoryLogic il           = new InventoryLogic();
            Inventory      objInventory = new Inventory();

            objInventory.RawMaterialID = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            objInventory.Quantity      = Convert.ToInt32(TextBox1.Text);
            //objInventory.TrDate = Convert.ToDateTime(TextBox2.Text);
            DateTime d1 = new DateTime();
            if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
            {
                objInventory.TrDate = DateTime.Today;
            }
            if (d1.ToShortDateString().Equals(DateTime.Today.ToShortDateString()))
            {
                objInventory.TrDate = DateTime.Now;
            }
            else
            {
                objInventory.TrDate = d1;
            }

            objInventory.Remarks    = TextBox3.Text;
            objInventory.EmployeeID = Convert.ToInt32(Session["EmployeeID"]);
            objInventory.GRNID      = 0;
            il.Insert(objInventory);

            Response.Redirect("InventoryList.aspx");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Label2.Visible = false;
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            string ans = "";
            foreach (RepeaterItem ri in Repeater1.Items)
            {
                CheckBox cb = (CheckBox)ri.FindControl("Checkbox1");
                if (cb.Checked)
                {
                    int invid = Convert.ToInt32(((Label)ri.FindControl("Label1")).Text);
                    ans += invid + ",";
                }
            }
            if (ans.Length > 1)
            {
                ans = ans.Substring(0, ans.Length - 1);
                Session["invids"] = ans;
                DataTable dt = new InventoryLogic().selectForPrint(ans);
                int       c  = 0;
                String    s  = "";
                foreach (DataRow row in dt.Rows)
                {
                    if (c == 0)
                    {
                        s = row["SupplierName"].ToString();
                        c++;
                    }
                    else
                    {
                        if (!row["SupplierName"].ToString().Equals(s))
                        {
                            Label2.Visible = true;
                            break;
                        }
                        else
                        {
                            Label2.Visible = false;
                        }

                        c++;
                    }
                }

                if (Label2.Visible == false)
                {
                    Response.Redirect("GenGRN.aspx");
                }
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     DataTable dt6 = new InventoryLogic().SelectRawStock();
 
    
     Repeater2.DataSource = dt6;
     Repeater2.DataBind();
 }
示例#32
0
        protected void DdlStatus_SelectedIndexChanged(object sender, EventArgs e)
        {
            string           status      = DdlStatus.SelectedValue;
            List <AVRequest> requestList = (status == "All" ? InventoryLogic.GetListOfAdjustmentRequests() : InventoryLogic.GetListOfAdjustmentRequests(status));

            GridViewAdjV.DataSource = requestList;
            GridViewAdjV.DataBind();
        }
        protected void BindGrid()
        {
            InventoryLogic            il       = new InventoryLogic();
            List <InventoryCatalogue> itemList = InventoryLogic.GetAllCatalogue().Where(x => x.Discontinued != "Y").ToList();

            GridViewAddRequest.DataSource = itemList;
            GridViewAddRequest.DataBind();
        }
        protected void BindGrid()
        {
            List <AVRequest> avRequestList = InventoryLogic.GetListOfAdjustmentRequests();

            avRequestList           = avRequestList.Where(x => x.Status == "Pending").ToList();
            GridViewAdjV.DataSource = avRequestList;
            GridViewAdjV.DataBind();
        }
示例#35
0
 /*
  * Purpose is to activate gate opening
  * Currenly only applicable to gate
  */
 public void PerformPurpose(InventoryLogic inventory)
 {
     _anim.SetBool("Activated", true);
     _audio.PlaySound();
     StartCoroutine(_showGate.MoveCamera(_gate));
     _gate.GetComponent <Gate>().CanOpen = true;
     _gate.GetComponent <IInteractive>().PerformPurpose(inventory);
 }
示例#36
0
        protected void BindGrid()
        {
            List <InventoryCatalogue> cList = InventoryLogic.GetAllCatalogue();

            GridViewCatalogue.DataSource = cList;
            GridViewCatalogue.DataBind();
            Session["CatalogueList"] = cList;
        }
    protected void Page_Load(object sender, EventArgs e)
    {

        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
       
            if (!IsPostBack)
            {
                if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("ACCOUNTATANT"))
                {

                InventoryLogic IL = new InventoryLogic();
                DataTable dt = IL.SelectAllJoined();
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
                if (dt.Rows.Count == 0)
                {
                    Table1.Visible = false;
                    Label3.Visible = true;
                }
                else
                {
                    Table1.Visible = true;
                    Label3.Visible = false;
                }

                 SupplierLogic sl = new SupplierLogic();
                DataTable dt1 = sl.SelectAll();
                dt1.Rows.Add(0,"All Supplier",null,null,null);
                dt1.DefaultView.Sort = "SupplierID";
                DropDownList1.DataSource = dt1;
                DropDownList1.DataTextField = "Name";
                DropDownList1.DataValueField = "SupplierID";
                DropDownList1.DataBind();
                DropDownList1.SelectedItem.Text = "All Supplier";
            }
                else
                {
                    Response.Redirect("Access.aspx");
                }
        }
        
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        
            if (!IsPostBack)
            {
                if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
                {
                RawMaterialLogic rl = new RawMaterialLogic();
                DropDownList1.DataSource = rl.SelectAll();
                DropDownList1.DataTextField = "Name";
                DropDownList1.DataValueField = "RawMaterialID";
                DropDownList1.DataBind();

                InventoryLogic il = new InventoryLogic();
                Inventory i1 = il.SelectByID(Convert.ToInt32(Request.QueryString["ID"]));
                if (i1.InventoryID > 0)
                {
                    RawMaterial r1 = rl.SelectByID(i1.RawMaterialID);
                    DropDownList1.SelectedItem.Value = r1.RawMaterialID.ToString();
                    TextBox1.Text = i1.Quantity.ToString();
                    TextBox2.Text = i1.TrDate.ToString("dd/MM/yyyy");
                    TextBox3.Text = i1.Remarks;
                }
            }
            else
            {
                Response.Redirect("Access.aspx");
            }
        }
          /*  else
            {
                RawMaterialLogic rl = new RawMaterialLogic();
                DropDownList1.DataSource = rl.SelectAll();
                DropDownList1.DataTextField = "Name";
                DropDownList1.DataValueField = "RawMaterialID";
                DropDownList1.DataBind();
            }*/
       
    }
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            InventoryLogic il = new InventoryLogic();
            BusinessLogic.Inventory e1 = il.SelectByID(Convert.ToInt32(e.CommandArgument));
            if (e1 != null)
            {

                il.Delete(e1.InventoryID);
                Response.Redirect("InventoryList.aspx");
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }

    }
示例#40
0
    IEnumerator WaitTillGenerateDatabase(InventoryLogic inventory)
    {
        while (inventory.itemDB.ItemDatabase.Count < 5)
        {
            yield return null;
        }

        inventory.gameObject.SetActive(false);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new AttendanceLogic().SelectForAttendanceReport(DateTime.Today);

        int present = Convert.ToInt32(dt.Rows[0][1]);
        int absent = Convert.ToInt32(dt.Rows[1][1]);


        lblPResentPerc.Text = ((float)present * 100) / ((float)present + absent) + "";
        lblPResentPerc.Attributes.Add("Present", present.ToString());
        lblPResentPerc.Attributes.Add("Absent", absent.ToString());

        DataTable dt1 = new InvoiceLogic().SelectForBestOrder();

        bestOrd.Text = dt1.Rows[0]["ProductName"].ToString();
        totalAmt.Text = dt1.Rows[0]["GrandTotal"].ToString();
        txtCustomer.Text = dt1.Rows[0]["CustomerName"].ToString();
        string dp = dt1.Rows[0]["ProductImage"].ToString();
        String[] arr = dp.Split(new String[] { "#,#" }, StringSplitOptions.RemoveEmptyEntries);
        proimg.Src = arr[arr.Length - 1];

        DataTable dt2 = new InvoiceLogic().SelectForRevenue();
        txtTotIncome.Text = dt2.Rows[0]["TotalIncome"].ToString();

        DataTable dt4 = new InvoiceLogic().SelectIndividualInvoiceAmount();
        string s = "";
        for (int i = 0; i < dt4.Rows.Count; i++)
        {
            s += dt4.Rows[i]["GrandTotal"] + ",";
        }
        s = "[" + s.TrimEnd(',') + "]";
        individualInvoiceAmount.Attributes.Add("data-data", s);


        DataTable dt3 = new ProductLogic().SelectBestProduct();
        OrderNumber.Text = dt3.Rows[0]["Total"].ToString() + " Orders";
        string dp1 = dt3.Rows[0]["DesignFiles"].ToString();
        String[] arr1 = dp1.Split(new String[] { "#,#" }, StringSplitOptions.RemoveEmptyEntries);
        topProimg.Src = arr1[arr1.Length - 1];

        ProName.Text = dt3.Rows[0]["Name"].ToString();
        
        DataTable dt5 = new InvoiceLogic().SelectTotalSale2();
        Repeater2.DataSource = dt5;
        Repeater2.DataBind();
        DataTable dt6 = new InventoryLogic().SelectRawStock();
        Repeater1.DataSource = dt6;
        Repeater1.DataBind();

        CustomerLogic CL = new CustomerLogic();
        Repeater3.DataSource = CL.SelectForReport1();
        Repeater3.DataBind();
        TransitionLogic ol = new TransitionLogic();
        Repeater9.DataSource = ol.SelectProductStatus1(DateTime.Today);
        Repeater9.DataBind();

        TransitionLogic ol2 = new TransitionLogic();
        Repeater4.DataSource = ol2.SelectOrderStatus1(DateTime.Today);
        Repeater4.DataBind();

    }
示例#42
0
 public void InitInventory(GameObject InventoryObject)
 {
     Inventory = InventoryObject;
     inventoryLogic = Inventory.GetComponent<InventoryLogic>();
 }
示例#43
0
 public void setInventory(InventoryLogic logic, InventoryRenderer renderer)
 {
     inventoryLogic = logic;        
 }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Label2.Visible = false;
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            string ans = "";
            foreach (RepeaterItem ri in Repeater1.Items)
            {
                CheckBox cb = (CheckBox)ri.FindControl("Checkbox1");
                if (cb.Checked)
                {
                    int invid = Convert.ToInt32(((Label)ri.FindControl("Label1")).Text);
                    ans += invid + ",";
                }
            }
            if (ans.Length > 1)
            {
                ans = ans.Substring(0, ans.Length - 1);
                Session["invids"] = ans;
                DataTable dt = new InventoryLogic().selectForPrint(ans);
                int c = 0;
                String s = "";
                foreach (DataRow row in dt.Rows)
                {

                    if (c == 0)
                    {
                        s = row["SupplierName"].ToString();
                        c++;
                    }
                    else
                    {
                        if (!row["SupplierName"].ToString().Equals(s))
                        {
                            Label2.Visible = true;
                            break;
                        }
                        else
                        {
                            Label2.Visible = false;
                        }

                        c++;


                    }
                }

                if (Label2.Visible == false)
                {
                    Response.Redirect("GenGRN.aspx");
                }

            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
         protected void Button1_Click(object sender, EventArgs e)
    {
        InventoryLogic il = new InventoryLogic();
        DateTime d1 = new DateTime();
        DateTime d2 = new DateTime();
        
            if (!DateTime.TryParseExact(TextBox1.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1))
            {
                    d1 = DateTime.Now.AddYears(-100);
            }

            if (!DateTime.TryParseExact(TextBox2.Text, "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d2))
            {
                    d2 = DateTime.Now.AddYears(+10);
            }
        
       
        DataTable dt = il.Search(d1,d2,Convert.ToInt32(DropDownList1.SelectedItem.Value));
        Repeater1.DataSource = dt;
        Repeater1.DataBind();
        if (dt.Rows.Count == 0)
        {
            Table1.Visible = false;
            Label3.Visible = true;
        }
        else
        {
            Table1.Visible = true;
            Label3.Visible = false;
        }
    }
示例#46
0
 void Awake()
 {
     inventoryLogic = GetComponent<InventoryLogic>();           
 }