예제 #1
0
        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();
        }
예제 #2
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;
        //}
    }
예제 #3
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();
 }
예제 #4
0
        private void SetBranchesPushCheckboxesState(Func <DataGridViewRow, bool> willPush)
        {
            // Necessary to end the edit mode of the Cell.
            BranchGrid.EndEdit();

            foreach (DataGridViewRow row in BranchGrid.Rows)
            {
                var pushCheckBox = row.Cells[PushColumn.Name] as DataGridViewCheckBoxCell;
                if (pushCheckBox == null || !pushCheckBox.Visible)
                {
                    continue;
                }

                pushCheckBox.Value = willPush(row);
            }
        }
예제 #5
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();
        }
예제 #6
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();
        }
예제 #7
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();
        }
예제 #8
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";
         }
     }
 }