Example #1
0
 public void LoadBranches()
 {
     if (Session["BranchTable"] != null)
     {
         try
         {
             dt = (DataTable)Session["BranchTable"];
             if (dt.Rows.Count == 0)
             {
                 //ResetBranches("Branches");
             }
             else
             {
                 BranchGrid.DataSource = dt;
                 BranchGrid.DataBind();
             }
         }
         catch { };
     }
     else
     {
         //ResetBranches("Branches");
     }
     ResetBranches("Loader");
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ICEBranchViewDiv.Style["height"] = sHeight;

            ICEDB     db = new ICEDB();
            DataTable dt;

            if (sECEType == 11)
            {
                dt = db.GetBranchStatusRV();
            }
            else
            {
                dt = db.GetBranchStatusHV();
            }
            //DataTable dt            = db.GetBranchStatus(sECEType);

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

            string HRV;

            if (sECEType > 11)
            {
                HRV = "HV";
                BranchGrid.RowStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#dee9fc");
            }
            else
            {
                HRV = "RV";
                BranchGrid.RowStyle.BackColor = System.Drawing.Color.LightYellow;
            }
            LblTotal.Text = "ICE -" + HRV;

            try
            {
                Flora.Text      = dt.Compute("SUM(C0)", "").ToString();
                HUB.Text        = dt.Compute("SUM(C1)", "").ToString();
                Maker.Text      = dt.Compute("SUM(C2)", "").ToString();
                Checker.Text    = dt.Compute("SUM(C3)", "").ToString();
                Approved.Text   = dt.Compute("SUM(C4)", "").ToString();
                Admin.InnerText = dt.Compute("SUM(C5)", "").ToString();
                Admin.HRef      = "../CreateORE.aspx?ECEType=" + sECEType;

                if ((Admin.InnerText != "0") && (Admin.InnerText != ""))
                {
                    Admin.Style["background-color"] = "Yellow";
                    Admin.Style["color"]            = "Red";
                }

                ORE.Text   = dt.Compute("SUM(C6)", "").ToString();
                Total.Text = dt.Compute("SUM(T)", "").ToString();
            }
            catch
            {
            }
            dt.Dispose();
            BranchGrid.Dispose();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RunDB     db = new RunDB();
            DataTable dt = db.GetRunCount();

            BranchGrid.DataSource = dt;
            BranchGrid.DataBind();
            dt.Dispose();
            BranchGrid.Dispose();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            OCEBranchViewDiv.Style["height"] = sHeight;
            OCEDB     db = new OCEDB();
            DataTable dt;

            if (sClearingType == 1)
            {
                dt = db.GetBranchStatusRV();
            }
            else
            {
                dt = db.GetBranchStatusHV();
            }

            //DataTable dt = db.GetBranchStatus(sClearingType);
            BranchGrid.DataSource = dt;
            BranchGrid.DataBind();

            string HRV;

            if (sClearingType > 1)
            {
                HRV = "HV";
                BranchGrid.RowStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#dee9fc");
            }
            else
            {
                HRV = "RV";
                BranchGrid.RowStyle.BackColor = System.Drawing.Color.LightYellow;
            }
            LblTotal.Text = "OCE -" + HRV;
            try
            {
                Scanman.Text    = dt.Compute("SUM(S1)", "").ToString();
                Maker.Text      = dt.Compute("SUM(S2)", "").ToString();
                Checker.Text    = dt.Compute("SUM(S4)", "").ToString();
                Admin.InnerText = dt.Compute("SUM(S5)", "").ToString();
                Admin.HRef      = "../CreateOCE.aspx?ClearingType=" + sClearingType;
                if ((Admin.InnerText != "0") && (Admin.InnerText != ""))
                {
                    Admin.Style["background-color"] = "Yellow";
                    Admin.Style["color"]            = "Red";
                }
                PBM.Text   = dt.Compute("SUM(S6)", "").ToString();
                Total.Text = dt.Compute("SUM(T)", "").ToString();
                IQA.Text   = dt.Compute("SUM(S8)", "").ToString();
                IRE.Text   = dt.Compute("SUM(S9)", "").ToString();
            }
            catch
            {
            }
            dt.Dispose();
            BranchGrid.Dispose();
        }
Example #5
0
    protected void ResetBranches(string GridToLoad)
    {
        DataTable dtLocal = new DataTable();
        //try
        //{
        DataSet dsLocal = SqlHelper.ExecuteDataset(connectionString, "[pSKUAnalysisLocs]");

        if (dsLocal.Tables.Count == 1)
        {
            dtLocal = dsLocal.Tables[0];
            dtLocal.Columns.Add("IsHub", typeof(Boolean));
            dtLocal.Columns.Add("SortKey", typeof(int));
            for (int i = 0; i < dtLocal.Rows.Count; i++)
            {
                DataRow drow = dtLocal.Rows[i];
                if (drow["Hub"].ToString() == "1")
                {
                    drow["IsHub"] = true;
                }
                else
                {
                    drow["IsHub"] = false;
                }
                drow["SortKey"] = i * 10000;
            }
            if (GridToLoad == "Branches")
            {
                BranchGrid.DataSource = dtLocal;
                BranchGrid.DataBind();
                Session["BranchTable"] = dtLocal;
            }
            if (GridToLoad == "Loader")
            {
                LoaderGrid.DataSource = dtLocal;
                LoaderGrid.DataBind();
                if (Session["BranchTable"] == null)
                {
                    dtLocal.Rows.Clear();
                    Session["BranchTable"] = dtLocal;
                }
            }
        }
        //}
        //catch (Exception ex)
        //{
        //    return null;
        //}
    }
Example #6
0
 public void ClearBranches(Object sender, EventArgs e)
 {
     if (Session["BranchTable"] != null)
     {
         try
         {
             dt = (DataTable)Session["BranchTable"];
             dt.Rows.Clear();
             BranchGrid.DataSource = dt;
             BranchGrid.DataBind();
             Session["BranchTable"] = dt;
         }
         catch { };
     }
     CatBegTextBox.Focus();
 }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ICEBranchViewDiv.Style["height"] = sHeight;

            ICEDB     db = new ICEDB();
            DataTable dt;

            if (sECEType == 11)
            {
                dt = db.GetBranchRejectedStatusRV();
            }
            else
            {
                dt = db.GetBranchRejectedStatusHV();
            }
            //DataTable dt            = db.GetBranchStatus(sECEType);

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

            string HRV;

            if (sECEType > 11)
            {
                HRV = "HV";
                BranchGrid.RowStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#dee9fc");
            }
            else
            {
                HRV = "RV";
                BranchGrid.RowStyle.BackColor = System.Drawing.Color.LightYellow;
            }
            LblTotal.Text = "ICE Rej -" + HRV;

            try
            {
                Maker.Text   = dt.Compute("SUM(C0)", "").ToString();
                Checker.Text = dt.Compute("SUM(C1)", "").ToString();
            }
            catch
            {
            }
            dt.Dispose();
            BranchGrid.Dispose();
        }
Example #8
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            ICEDB db = new ICEDB();

            DataTable dt = db.GetZoneStatus(Int32.Parse(Request.Cookies["ZoneID"].Value), Int32.Parse(Session["CurrentClearingType"].ToString()));

            BranchGrid.DataSource = dt;
            BranchGrid.DataBind();
            try
            {
                BranchGrid.FooterRow.Cells[1].Text = dt.Compute("SUM(Maker)", "").ToString();
                BranchGrid.FooterRow.Cells[2].Text = dt.Compute("SUM(Checker)", "").ToString();
            }
            catch
            {
            }
            dt.Dispose();
            BranchGrid.Dispose();
        }
Example #9
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            DropDownList ECEList = (DropDownList)Page.FindControl("ClearingTypeList");
            DropDownList BrList  = (DropDownList)Page.FindControl("BranchList");

            ICEDB     db = new ICEDB();
            DataTable dt = db.GetCheckQueue(Int32.Parse(BrList.SelectedValue), Int32.Parse(ECEList.SelectedValue));

            BranchGrid.DataSource = dt;
            BranchGrid.DataBind();
            try
            {
                BranchGrid.FooterRow.Cells[1].Text = dt.Compute("SUM(CheckCount)", "").ToString();
                BranchGrid.FooterRow.Cells[2].Text = dt.Compute("SUM(TotalAmount)", "").ToString();
            }
            catch
            {
            }
            dt.Dispose();
            BranchGrid.Dispose();
        }
Example #10
0
 protected void BranchCommand(object source, GridViewCommandEventArgs e)
 {
     ClearPageMessages();
     CatBegTextBox.Focus();
     dt = (DataTable)Session["BranchTable"];
     if (e.CommandName == "Del")
     {
         int    index          = Convert.ToInt32(e.CommandArgument);
         string BranchToRemove = BranchGrid.Rows[index].Cells[0].Text;
         dt.Rows.RemoveAt(index);
         BranchGrid.DataSource = dt;
         BranchGrid.DataBind();
         Session["BranchTable"] = dt;
     }
     if (e.CommandName == "Hub")
     {
         int     index = Convert.ToInt32(e.CommandArgument);
         DataRow drow  = dt.Rows[index];
         drow["IsHub"]         = !(Boolean)drow["IsHub"];
         BranchGrid.DataSource = dt;
         BranchGrid.DataBind();
         Session["BranchTable"] = dt;
     }
     if (e.CommandName == "MoveUp")
     {
         int index = Convert.ToInt32(e.CommandArgument);
         if (index > 0)
         {
             DataRow drow1  = dt.Rows[index];
             int     oldKey = (int)drow1["SortKey"];
             DataRow drow2  = dt.Rows[index - 1];
             drow1["SortKey"] = drow2["SortKey"];
             drow2["SortKey"] = oldKey;
             DataView dv = new DataView(dt, "", "SortKey", DataViewRowState.CurrentRows);
             dt = dv.ToTable();
         }
         BranchGrid.DataSource = dt;
         BranchGrid.DataBind();
         Session["BranchTable"] = dt;
     }
     if (e.CommandName == "MoveDown")
     {
         int index = Convert.ToInt32(e.CommandArgument);
         if (index < dt.Rows.Count - 1)
         {
             DataRow drow1  = dt.Rows[index];
             int     oldKey = (int)drow1["SortKey"];
             DataRow drow2  = dt.Rows[index + 1];
             drow1["SortKey"] = drow2["SortKey"];
             drow2["SortKey"] = oldKey;
             DataView dv = new DataView(dt, "", "SortKey", DataViewRowState.CurrentRows);
             dt = dv.ToTable();
         }
         BranchGrid.DataSource = dt;
         BranchGrid.DataBind();
         Session["BranchTable"] = dt;
     }
     if (e.CommandName == "AddToList")
     {
         int     index   = Convert.ToInt32(e.CommandArgument);
         DataRow workRow = dt.NewRow();
         workRow["Code"] = LoaderGrid.Rows[index].Cells[0].Text;
         workRow["Name"] = LoaderGrid.Rows[index].Cells[1].Text;
         if (dt.Select("Code = '" + workRow["Code"] + "'").Length == 0)
         {
             if (LoaderGrid.Rows[index].Cells[2].Text == "True")
             {
                 workRow["Hub"]   = 1;
                 workRow["IsHub"] = true;
             }
             else
             {
                 workRow["Hub"]   = 0;
                 workRow["IsHub"] = false;
             }
             if (dt.Rows.Count == 0)
             {
                 workRow["SortKey"] = 10000;
             }
             else
             {
                 workRow["SortKey"] = (int)dt.Rows[dt.Rows.Count - 1]["SortKey"] * 10000;
             }
             dt.Rows.Add(workRow);
             BranchGrid.DataSource = dt;
             BranchGrid.DataBind();
             Session["BranchTable"] = dt;
         }
         else
         {
             lblErrorMessage.Text = "Branch " + workRow["Code"].ToString() + " is already in the list";
         }
     }
 }