Exemple #1
0
        public ActionResult Order_Input(string id)
        {
            Order_InputBL      obl  = new Order_InputBL();
            M_JobTimeableModel Mjob = new M_JobTimeableModel();
            DataSet            dst  = new DataSet();

            //  string ItemCD = "cps-test,cd";
            dst = obl.Order_Input_M_Item_Data(id);
            DataSet dsnew    = new DataSet();
            String  Img_Name = "";

            if (dst.Tables.Count > 0)
            {
                int tabcount = 0;
                int count    = dst.Tables.Count;
                for (int i = 0; i < count; i++)
                {
                    if (dst.Tables[i].Rows.Count == 0)
                    {
                        dst.Tables.RemoveAt(i);
                        count--;
                        i--;
                    }
                    else
                    {
                        DataTable dtnew = dst.Tables[i];
                        Img_Name += dtnew.Rows[0]["ImageName"].ToString() + ",";
                        dtnew.Columns.Remove("ImageName");
                        dtnew.TableName = "Table" + tabcount;
                        tabcount++;
                        //dsnew.Tables.Add(dst.Tables[i].Copy());
                        dsnew.Tables.Add(dtnew.Copy());
                    }
                }
            }
            if (!string.IsNullOrWhiteSpace(Img_Name) && Img_Name.Contains(","))
            {
                Img_Name = Img_Name.Remove(Img_Name.Length - 1);
            }
            ViewBag.ImageName    = Img_Name;
            Session["MakerItem"] = id;
            ViewBag.count        = dsnew.Tables.Count;
            Session["dtsmitem"]  = dsnew;
            if (Session["CompanyCD"] != null)
            {
                Mjob.CompanyCD      = Session["CompanyCD"].ToString();
                ViewData["JobTime"] = obl.JobTimeTable_Select(Mjob);
                return(View());
            }
            else
            {
                ViewData["JobTime"] = Mjob;
                return(View());
            }
        }
Exemple #2
0
        public ActionResult Order_Portal()
        {
            M_JobTimeableModel Mjob = new M_JobTimeableModel();

            if (Session["CompanyCD"] != null)
            {
                Order_InputBL obl = new Order_InputBL();
                Mjob.CompanyCD      = Session["CompanyCD"].ToString();
                ViewData["JobTime"] = obl.JobTimeTable_Select(Mjob);

                return(View());
            }
            else
            {
                ViewData["JobTime"] = Mjob;
                return(View());
            }
        }