コード例 #1
0
ファイル: ShowOrder.aspx.cs プロジェクト: deomca/AdsWeb
        void GridUserHistory_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            AdsCom.UserHistory uh = e.Row.DataItem as AdsCom.UserHistory;
            Label lblBy           = (Label)e.Row.FindControl("lblBy");
            User  usr             = new User();
            int   str             = uh.User_Id;

            usr.Load(str);
            lblBy.Text = usr.RealName;
            //lblUserBy.Text = ins.USER_ID.ToString();
            Label lblCommentDate = (Label)e.Row.FindControl("lblCommentDate");

            lblCommentDate.Text = uh.Allocated_Date.ToString("MM/dd/yyyy");  // oh.DATE.ToString(("MM/dd/yyyy"));
            LinkButton hypGetHistory = (LinkButton)e.Row.FindControl("hypGetHistory");
            //hypGetHistory.CommandArgument = uh.Id;
        }
コード例 #2
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);
            }
        }
コード例 #3
0
ファイル: ShowOrder.aspx.cs プロジェクト: deomca/AdsWeb
        protected void btnSubmitAdmin_Click(object sender, EventArgs e)
        {
            int insid = 0;

            if (!Page.IsValid)
            {
                return;
            }
            if (!String.IsNullOrEmpty(txtInstructions.Text))
            {
                o = new Order();
                Instructions ins = new Instructions();
                ins.ADDITIONALINSTRUCTION = txtInstructions.Text;
                ins.USER_ID = Convert.ToInt32(Session["USER_ID"]);
                if (Request["AID"] != null)
                {
                    o.Load(Convert.ToInt32(Request["AID"]));
                }
                ins.ORDER_ID = o.ORDER_ID;
                ins.Date     = DateTime.Now;
                ins.Save();

                string str2 = "select max(INSTRUCTION_ID) from INSTRUCTIONS ";
                com = new SqlCommand(str2, con);
                SqlDataAdapter adp = new SqlDataAdapter(com);
                DataSet        ds  = new DataSet();
                adp.Fill(ds);
                con.Open();
                SqlDataReader reader = com.ExecuteReader(CommandBehavior.CloseConnection);


                if (reader.Read())
                {
                    insid = Convert.ToInt32(reader[0]);
                }
                con.Close();
            }

            if (Request["AID"] != null)
            {
                o.Load(Convert.ToInt32(Request["AID"]));
            }
            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.IMAGE_LIST           = lblImageList.Text;
            if (!String.IsNullOrEmpty(txtAlbumId.Text))
            {
                o.ALBUM_ID = Convert.ToInt16(txtAlbumId.Text);
            }
            else
            {
                o.ALBUM_ID = 0;
            }
            o.ALBUM_NAME = txtAlbumName.Text;
            if (!String.IsNullOrEmpty(txtImages.Text))
            {
                o.IMAGES = Convert.ToInt32(txtImages.Text);
            }
            else
            {
                o.IMAGES = 0;
            }

            o.ACTION = Convert.ToInt16(drpSubmitAs.SelectedValue);
            //if (!String.IsNullOrEmpty(drpRating.SelectedValue))

            o.ALBUM_RATING = Convert.ToInt16(drpRating.SelectedValue);

            AdsCom.UserHistory         uh      = new AdsCom.UserHistory();
            IList <AdsCom.UserHistory> userhis = new List <AdsCom.UserHistory>();

            userhis = AdsCom.UserHistory.LoadByOrderId(o.ORDER_ID);
            if (!String.IsNullOrEmpty(txtQcComment.Text))
            {
                o.COMMENTS = txtQcComment.Text;
            }


            o.PRIORITY  = Convert.ToInt16(rbPriortiy.SelectedValue);
            o.STATUS_ID = Convert.ToInt16(drpCurrentStatusId.SelectedValue);
            if (!String.IsNullOrEmpty(txtInstructions.Text))
            {
                o.INSTRUCTION_ID = insid;
            }
            o.Save();

            AdsCom.Priority pr  = new AdsCom.Priority();
            Regex           rx  = new Regex("<[^>]*>");
            string          str = rx.Replace(rbPriortiy.SelectedItem.Text, "");

            if (o.PRIORITY > 1)
            {
                pr.Priority_Id   = o.PRIORITY;
                pr.Priority_Name = str;
                pr.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 = o.COMMENTS;

            oh.Save();
            if (!String.IsNullOrEmpty(txtInstructions.Text))
            {
                oh.ORDER_ID = o.ORDER_ID;
                oh.USER_ID  = o.USER_ID;
                oh.DATE     = DateTime.Now;
                oh.ADDITIONALINSTRUCTION = txtInstructions.Text;
                oh.Save();
            }
            Response.Redirect("ShowOrder.aspx?AID=" + o.Id);
        }
コード例 #4
0
ファイル: ShowOrder.aspx.cs プロジェクト: deomca/AdsWeb
        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"]);
        }