コード例 #1
0
        public OutstandingInfoBO getOutstanding(string itemNumber, string depId) //To get outstanding by depId
        {
            OutstandingInfo   oi = d.getOutstandingByItemNumberAndDepId(itemNumber, depId);
            OutstandingInfoBO o  = convertOutstandingToOutstandingBO(oi);

            return(o);
        }
コード例 #2
0
        public OutstandingInfoBO convertOutstandingToOutstandingBO(OutstandingInfo o)
        {
            OutstandingInfoBO obo = new OutstandingInfoBO();

            obo.ItemNumber             = o.ItemNumber;
            obo.Quantity               = o.Quantity;
            obo.OutstandingId          = o.OutstandingID;
            obo.DepartmentId           = o.DepartmentID;
            obo.PartialPendingQuantity = o.PartialPendingQty;
            obo.Status = o.Status;

            return(obo);
        }
        public void UpdateDisbursement()
        {
            ebo    = (EmployeeBO)Session["employee"];
            deptid = ebo.EmployeeDept;
            List <ReadyForCollectionBO> rcboLst = new List <ReadyForCollectionBO>();
            List <OutstandingInfoBO>    oLst    = new List <OutstandingInfoBO>();

            foreach (GridViewRow row in GridView1.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    CheckBox c = (CheckBox)row.FindControl("choose");


                    if (c.Checked)
                    {
                        TextBox t              = (TextBox)row.FindControl("tbDisbursementQty");
                        string  orderedQTy     = row.Cells[6].Text;                                                //3rd feb
                        string  distributedQty = t.Text;                                                           //3rd feb
                        if (Convert.ToInt32(row.Cells[3].Text) != 0)                                               //3rd feb
                        {
                            ReadyForCollectionBO rcbo = new ReadyForCollectionBO();
                            rcbo.DepId = deptid;

                            rcbo.ItemNumber        = row.Cells[1].Text;
                            rcbo.ReqisitionId      = row.Cells[7].Text;
                            rcbo.DisbursedQuantity = Convert.ToInt32(t.Text);
                            rcboLst.Add(rcbo);
                        }
                        else                                                                                      //3rd feb
                        {
                            OutstandingInfoBO o = dbl.getOutstanding(row.Cells[1].Text, deptid);

                            o.Quantity = Convert.ToInt32(orderedQTy) + o.Quantity - Convert.ToInt32(distributedQty);



                            dbl.updateOutstanding(row.Cells[1].Text, deptid, (int)o.Quantity);
                        }
                    }
                }
            }

            dbl.updateDisbursementStatus(rcboLst);
        }