Example #1
0
        void grdAds_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            Order  o   = (Order)e.Row.DataItem;
            Status s   = new Status();
            int    sts = o.STATUS_ID;

            s.Load(sts);

            IList <Order> orders = new List <Order>();

            orders = o.LoadByUserId(Convert.ToInt32(Session["USER_ID"]));

            Label lblAllocated = (Label)e.Row.FindControl("lblAllocated");
            User  u            = new User();
            int   usr          = o.USER_ID;

            u.Load(usr);
            if (usr == 0)
            {
                lblAllocated.Text = "No One";
            }

            else
            {
                lblAllocated.Text = u.RealName;
            }


            if (chkTake == false && orders.Count == 0)
            {
                e.Row.Cells[9].Visible = true;
                chkTake = true;
            }
            else
            {
                e.Row.Cells[9].Visible = false;
                User u1 = new User();
                u1.Load(Convert.ToInt32(Session["USER_ID"]));
                if (u1.STATUS_ID != 3)
                {
                    e.Row.Cells[10].Visible = false;

                    if (Request["UserId"].ToString() == "0")
                    {
                        e.Row.Cells[10].Visible = false;
                    }
                    else if (Request["UserId"].ToString() == "x" && (u1.RealName != lblAllocated.Text))
                    {
                        e.Row.Cells[10].Visible = false;
                    }
                    else if (u1.RealName == lblAllocated.Text)
                    {
                        e.Row.Cells[10].Visible = true;
                    }
                    else
                    {
                        e.Row.Cells[10].Visible = true;
                    }
                }
            }

            Label lblSeriolNo = (Label)e.Row.FindControl("lblSeriolNo");

            lblSeriolNo.Text = i.ToString();
            i++;

            Label lblOrderDate = (Label)e.Row.FindControl("lblOrderDate");

            lblOrderDate.Text = o.ORDER_DATE.ToString(("MM/dd/yyyy"));

            Label    lblPriority = (Label)e.Row.FindControl("lblPriority");
            Priority pr          = new Priority();
            int      pri         = o.PRIORITY;

            pr.Load(pri);
            if (pr.Priority_Name == "Regular")
            {
                lblPriority.ForeColor = System.Drawing.Color.Black;
                lblPriority.Text      = pr.Priority_Name;
            }
            else
            {
                lblPriority.ForeColor = System.Drawing.Color.Red;
            }
            lblPriority.Text = pr.Priority_Name;

            Label lblStatus = (Label)e.Row.FindControl("lblStatus");

            lblStatus.Text = s.ORDER_STATUS;



            Label  lblLastDesigner = (Label)e.Row.FindControl("lblLastDesigner");
            Label  lblLastQA       = (Label)e.Row.FindControl("lblLastQa");
            Change change          = new Change();
            Change ch = change.LoadByOrderId(Convert.ToInt32(o.ORDER_ID));

            lblLastDesigner.Text = ch.Design_By_Name;
            lblLastQA.Text       = ch.Qa_By_Name;

            IList <AdsCom.UserHistory> usrHis = AdsCom.UserHistory.LoadByOrderId(o.ORDER_ID);

            if (usrHis.Count > 0)
            {
                User        usrs      = new User();
                UserHistory uh        = new UserHistory();
                int         hisUserId = AdsCom.UserHistory.LoadByOrderId(o.ORDER_ID)[0].User_Id;
                usrs.Load(hisUserId);
                string name = usrs.RealName;

                Label  lblLastComment = (Label)e.Row.FindControl("lblLastComment");
                string strAction      = string.Empty;
                if (o.ACTION == 1)
                {
                    strAction = "Completed";
                }
                else if (o.ACTION == 2)
                {
                    strAction = "Hold";
                }
                else if (o.ACTION == 3)
                {
                    strAction = "Return";
                }

                lblLastComment.Text = strAction + " (" + o.ALBUM_RATING + ") " + o.COMMENTS + "  ( By " + name + ") ";
            }
            LinkButton hypTake = (LinkButton)e.Row.FindControl("hypTake");

            hypTake.CommandArgument = o.Id.ToString();
            //hypTake. = "ListQueue.aspx?StatusId=" + o.Status + "&UserId=" + Session["USER_ID"] + "";

            HyperLink hypView = (HyperLink)e.Row.FindControl("hypView");

            hypView.NavigateUrl = "ShowOrder.aspx?AID=" + o.Id + "&UserId=" + Session["USER_ID"] + "";
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            grdAdditionalIns.RowDataBound += new GridViewRowEventHandler(grdAdditionalIns_RowDataBound);
            GridUserHistory.RowDataBound  += new GridViewRowEventHandler(GridUserHistory_RowDataBound);
            if (Page.IsPostBack)
            {
                return;
            }
            PopulateUser();
            u = new User();
            u.Load(Convert.ToInt32(Session["USER_ID"]));
            if (u.STATUS_ID == 3)
            {
                spnRating.Visible      = true;
                drpRating.Visible      = true;
                btnSubmitAdmin.Visible = true;
            }
            else if (u.STATUS_ID == 2)
            {
                spnRating.Visible      = true;
                drpRating.Visible      = true;
                btnSubmitAdmin.Visible = false;
            }
            else
            {
                spnRating.Visible      = false;
                drpRating.Visible      = false;
                btnSubmitAdmin.Visible = false;
            }

            if (Request["AID"] != null)
            {
                o.Load(Convert.ToInt32(Request["Aid"]));
                orderid                  = o.ORDER_ID;
                lblOrderId.Text          = o.ORDER_ID.ToString();
                txtEventId.Text          = o.EVENT_ID.ToString();
                lblStudioId.Text         = o.GRAPHER_ID;
                txtFolderName.Text       = o.FOLDER_NAME;
                txtPages.Text            = o.PAGES.ToString();
                drpBind.SelectedValue    = o.ALBUM_TYPE.ToString();
                drpStyle.SelectedValue   = o.ALBUM_STYLE.ToString();
                drpSize.SelectedValue    = o.ALBUM_SIZE.ToString();
                drpUserId.SelectedValue  = o.USER_ID.ToString();
                lblInstruction.Text      = o.SPECIAL_INSTRUCTIONS;
                lblOriginalId.Text       = o.ORIGINAL_ALBUM_ID.ToString();
                lblImageList.Text        = o.IMAGE_LIST;
                txtAlbumId.Text          = o.ALBUM_ID.ToString();
                rbPriortiy.SelectedValue = o.PRIORITY.ToString();
                txtAlbumName.Text        = o.ALBUM_NAME;
                txtImages.Text           = o.IMAGES.ToString();

                drpSubmitAs.SelectedValue = "1";

                drpRating.SelectedValue = "0";
                Change change = new Change();
                Change ch     = change.LoadByOrderId(Convert.ToInt32(o.ORDER_ID));
                lblLastDesigner.Text = ch.Design_By_Name;
                lblLastQa.Text       = ch.Qa_By_Name;

                IList <AdsCom.UserHistory> usrHis = AdsCom.UserHistory.LoadByOrderId(o.ORDER_ID);
                if (usrHis.Count > 0)
                {
                    User        usr = new User();
                    UserHistory uh  = new UserHistory();
                    //UserHistory u = uh.LoadByUserId(Convert.ToInt32(Request["UserId"]));
                    //UserHistory u = uh.LoadByUserId(Convert.ToInt32(Request["UserId"]));

                    //int str = uh.User_Id;
                    //usr.Load(str);
                    //string history = AdsCom.UserHistory.LoadByOrderId(o.ORDER_ID)[0].Comments.ToString();
                    int hisUserId = usrHis[0].User_Id;
                    usr.Load(hisUserId);
                    string strAction = string.Empty;
                    if (o.ACTION == 1)
                    {
                        strAction = "Completed";
                    }
                    else if (o.ACTION == 2)
                    {
                        strAction = "Hold";
                    }
                    else if (o.ACTION == 3)
                    {
                        strAction = "Return";
                    }
                    lblLastComment.Text = strAction + " (" + o.ALBUM_RATING + ") " + o.COMMENTS + "  ( By " + usr.RealName + ") ";
                }



                drpSubmitTo.SelectedValue        = o.STATUS_ID.ToString();
                drpCurrentStatusId.SelectedValue = o.STATUS_ID.ToString();

                LoadAminInstruction();
                LoadUserHistory();
                hypGetHistory.Attributes.Add("OnClick", "popwinHistory('" + o.ORDER_ID + "');");
            }
        }