示例#1
0
        void grdAds_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Save")
            {
                o = new Order();
                o.Load(Convert.ToInt32(e.CommandArgument));
                o.STATUS_ID = Convert.ToInt32(Request["StatusId"]);
                o.USER_ID   = Convert.ToInt32(Session["USER_ID"]);

                o.Save();

                AdsCom.OrderHistory oh = new AdsCom.OrderHistory();
                oh.ORDER_ID      = o.ORDER_ID;
                oh.USER_ID       = Convert.ToInt32(Session["USER_ID"]);
                oh.USERALLOCATED = Convert.ToInt32(Session["USER_ID"]);
                oh.ORDER_STATUS  = o.STATUS_ID;
                oh.DATE          = DateTime.Now;
                //string strAction = string.Empty;
                //if (o.ACTION == 1)
                //    strAction = "Completed";
                //else if (o.ACTION == 2)
                //    strAction = "Hold";
                //else if (o.ACTION == 3)
                //    strAction = "Return";
                // strAction + " (" + o.ALBUM_RATING + ") " +
                oh.ADDITIONALINSTRUCTION = o.COMMENTS;

                oh.Save();

                AdsCom.UserHistory uh = new AdsCom.UserHistory();
                uh.Order_Id       = o.ORDER_ID;
                uh.User_Id        = Convert.ToInt32(Session["USER_ID"]);
                uh.Allocated_Date = DateTime.Now;
                uh.Submitted_Date = DateTime.MaxValue;
                uh.Totaltime      = DateTime.MaxValue;
                uh.Save();

                Response.Redirect("ListQueue.aspx?Userid=" + o.USER_ID);
            }
        }
示例#2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            o = new Order();
            if (Request["AID"] != null)
            {
                o.Load(Convert.ToInt32(Request["AID"]));
            }
            // Session["ORDER_ID"] = o.ORDER_ID;
            o.ORDER_ID             = Convert.ToInt16(lblOrderId.Text);
            o.EVENT_ID             = Convert.ToInt16(txtEventId.Text);
            o.GRAPHER_ID           = lblStudioId.Text;
            o.FOLDER_NAME          = txtFolderName.Text;
            o.PAGES                = Convert.ToInt16(txtPages.Text);
            o.ALBUM_TYPE           = Convert.ToInt16(drpBind.SelectedValue);
            o.ALBUM_STYLE          = Convert.ToInt16(drpStyle.SelectedValue);
            o.ALBUM_SIZE           = Convert.ToInt16(drpSize.SelectedValue);
            o.USER_ID              = Convert.ToInt16(drpUserId.SelectedValue);
            o.SPECIAL_INSTRUCTIONS = lblInstruction.Text;
            o.ORIGINAL_ALBUM_ID    = Convert.ToInt16(lblOriginalId.Text);
            o.PRIORITY             = Convert.ToInt16(rbPriortiy.SelectedValue);
            o.IMAGE_LIST           = lblImageList.Text;
            o.ALBUM_ID             = Convert.ToInt16(txtAlbumId.Text);
            o.ALBUM_NAME           = txtAlbumName.Text;
            o.IMAGES               = Convert.ToInt16(txtImages.Text);
            o.ACTION               = Convert.ToInt16(drpSubmitAs.SelectedValue);
            // if (!String.IsNullOrEmpty(drpRating.SelectedValue))
            o.ALBUM_RATING = Convert.ToInt16(drpRating.SelectedValue);

            o.COMMENTS = txtQcComment.Text;
            if (!String.IsNullOrEmpty(txtInstructions.Text))
            {
                o.INSTRUCTION_ID = Convert.ToInt16(lblNewInstruction.Text);
            }
            o.STATUS_ID = Convert.ToInt16(drpSubmitTo.SelectedValue);
            o.USER_ID   = 0;

            o.Save();

            Change ch = new Change();
            Change c  = ch.LoadByOrderId(o.ORDER_ID);

            c.Order_Id = o.ORDER_ID;

            User usr = new User();
            int  str = Convert.ToInt32(Session["USER_ID"]);

            usr.Load(str);

            if (c.Id != 0)
            {
                Change ch2 = new Change();
                ch2.Load(c.Id);
                if (o.STATUS_ID == 2)
                {
                    ch2.Design_By_Id   = Convert.ToInt32(Session["USER_ID"]);
                    ch2.Design_By_Name = usr.RealName;
                }
                else if (o.STATUS_ID == 3)
                {
                    ch2.Qa_By_Id   = Convert.ToInt32(Session["USER_ID"]);
                    ch2.Qa_By_Name = usr.RealName;
                }
                ch2.Save();
            }
            else
            {
                if (o.STATUS_ID == 2)
                {
                    c.Design_By_Id   = Convert.ToInt32(Session["USER_ID"]);
                    c.Design_By_Name = usr.RealName;
                }
                else if (o.STATUS_ID == 3)
                {
                    c.Qa_By_Id   = Convert.ToInt32(Session["USER_ID"]);
                    c.Qa_By_Name = usr.RealName;
                }
                c.Save();
            }


            AdsCom.OrderHistory oh = new AdsCom.OrderHistory();
            oh.ORDER_ID      = o.ORDER_ID;
            oh.USER_ID       = Convert.ToInt32(Session["USER_ID"]);
            oh.USERALLOCATED = Convert.ToInt16(drpUserId.SelectedValue);
            oh.ORDER_STATUS  = Convert.ToInt16(drpSubmitTo.SelectedValue);
            oh.DATE          = DateTime.Now;
            string strAction = string.Empty;

            if (o.ACTION == 1)
            {
                strAction = "Completed";
            }
            else if (o.ACTION == 2)
            {
                strAction = "Hold";
            }
            else if (o.ACTION == 3)
            {
                strAction = "Return";
            }
            oh.ADDITIONALINSTRUCTION = strAction + " (" + o.ALBUM_RATING + ") " + o.COMMENTS;

            oh.Save();
            //Regex rx = new Regex("<[^>]*>");
            //string str = rx.Replace(rbPriortiy.SelectedItem.Text, "");
            //o.PRIORITY = Convert.ToInt16(rbPriortiy.SelectedValue);

            AdsCom.UserHistory uh = new AdsCom.UserHistory();
            int str1 = Convert.ToInt32(Session["USER_ID"]);

            uh.Load(str1);
            uh.Order_Id = o.ORDER_ID;
            uh.User_Id  = Convert.ToInt32(Session["USER_ID"]);
            string strAction1 = string.Empty;

            if (o.ACTION == 1)
            {
                strAction1 = "Completed";
            }
            else if (o.ACTION == 2)
            {
                strAction1 = "Hold";
            }
            else if (o.ACTION == 3)
            {
                strAction1 = "Return";
            }

            uh.Comments       = strAction1 + " (" + o.ALBUM_RATING + ") " + o.COMMENTS;
            uh.Status_Id      = Convert.ToInt16(drpSubmitTo.SelectedValue);
            uh.Allocated_Date = DateTime.Now;
            uh.Submitted_Date = DateTime.Now;
            uh.Images         = o.IMAGES;
            uh.Pages          = o.PAGES;
            uh.Totaltime      = DateTime.Now;
            uh.Save();
            Response.Redirect("ListQueue.aspx?UserId=" + Session["USER_ID"]);
        }