예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Msg msg = MetriesModel.QueryMatries();
                if (msg.Status)
                {
                    List <Tbl_Materies> list = msg.UserData as List <Tbl_Materies>;
                    GridView1.DataSource = BuildGridViewDataSource(list);
                    GridView1.DataBind();
                }

                Msg projectMsg = MetriesModel.QueryProjectName();
                if (projectMsg.Status)
                {
                    StringBuilder   build    = new StringBuilder();
                    List <Tbl_Plan> planList = projectMsg.UserData as List <Tbl_Plan>;
                    for (int i = 0; i < planList.Count; i++)
                    {
                        build.Append(@"<div onclick='urlLocation(" + planList[i].PlanID + ")' style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><strong>项目名:" + planList[i].ProjectName + "</strong><span style='right:8px;position:absolute'><img onclick='urlLocation(" + planList[i].PlanID + ")' alt='' style='height: 16px;'src='../../Images/minicalendar/ic_enter.png'/></span></div>");
                    }
                    list.InnerHtml = build.ToString();
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sPlanId = this.Request["PlanId"];
            Msg    msg     = MetriesModel.QueryProject(int.Parse(sPlanId));

            if (msg.Status)
            {
                List <Tbl_Materies> list = msg.UserData as List <Tbl_Materies>;
                GridView1.DataSource = BuildGridViewDataSource(list);
                GridView1.DataBind();
            }
        }
예제 #3
0
        public static Msg QueryUnsure(int access)
        {
            Msg msg = null;


            if (access == (int)UserData.项目主管)
            {
                msg = PlanModel.QueryUnsurePlan();
            }
            if (access == (int)UserData.设计主管)
            {
                msg = MetriesModel.AGetUnsureMatries();
            }
            return(msg);
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <string> msg   = MetriesModel.GetUnsureMatries();
            StringBuilder build = new StringBuilder();

            List <string> listName = MetriesModel.GetMetriesProjectName(msg);

            for (int i = 0; i < msg.Count; i++)        //循环查找材料表中未提交的项目,并动态添加控件
            {
                string sPlanId = msg[i].ToString();;

                build.Append(@"<div onclick='urlLocation(" + msg[i] + ")' style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><strong>项目名:" + listName[i] + "</strong><span style='right:8px;position:absolute'><img onclick='urlLocation(" + msg[i] + ")' alt='' style='height: 16px;'src='../../Images/minicalendar/ic_enter.png'/></span></div>");
            }

            list.InnerHtml = build.ToString();
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string sPlanId = this.Request["PlanID"];
         Msg    msg     = MetriesModel.GetMetriesByMatriesId(int.Parse(sPlanId));
         if (msg.Status)
         {
             StringBuilder build = new StringBuilder();
             lPlan = msg.UserData as List <Tbl_Materies>;
             GridView1.DataSource = BuildGridViewDataSource(lPlan);
             GridView1.DataBind();
             if (lPlan.Count == 0)
             {
                 Ensure.Enabled = false;
             }
         }
     }
 }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Msg           msg   = MetriesModel.GetUnDesignedPlan();
            StringBuilder build = new StringBuilder();

            if (msg.Status)
            {
                List <Tbl_Plan> lPlans = msg.UserData as List <Tbl_Plan>;
                if (lPlans.Count > 0)
                {
                    for (int i = 0; i < lPlans.Count; i++)//循环查找材料表中未提交的项目,并动态添加控件
                    {
                        string sPlanId = lPlans[i].PlanID.ToString();;

                        build.Append(@"<div onclick='urlLocation(" + lPlans[i].PlanID + ")' style='margin-bottom:10px;padding:12px 15px;line-height:13px; background:#E5E3E4;'><strong>项目名:" + lPlans[i].ProjectName + "</strong><span style='right:8px;position:absolute'><img onclick='urlLocation(" + lPlans[i].PlanID + ")' alt='' style='height: 16px;'src='../../Images/minicalendar/ic_enter.png'/></span></div>");
                    }
                }
                list.InnerHtml = build.ToString();
            }
        }
예제 #7
0
        protected void Ensure(object sender, EventArgs e)
        {
            string       sPlanId  = this.Request["PlanID"];
            bool         isHave   = MetriesModel.GetMetriesById(int.Parse(sPlanId));
            Tbl_Materies oMatries = new Tbl_Materies();

            oMatries.PlanID        = int.Parse(sPlanId);
            oMatries.ProjectName   = txbProjectName.Text;
            oMatries.TotalNum      = int.Parse(txbCount.Text);
            oMatries.MateriesType  = txbMatriesType.Text;
            oMatries.Date          = DateTime.Now;
            oMatries.BuildName     = txbBuildName.Text;
            oMatries.BuildNum      = txbBuildId.Text;
            oMatries.NowAdmStatus  = 1;
            oMatries.ProcessingNum = txbWorkMapId.Text;
            if (!isHave)//不存在,插入
            {
                Msg msg = MetriesModel.AddMateries(oMatries);
                if (msg.Status)
                {
                    PageHelper.ShowAlertMsg(this, "编辑材料表成功");
                }
                else
                {
                    PageHelper.ShowAlertMsg(this, msg.Message);
                }
            }
            else
            {
                Msg msg = MetriesModel.UpdateMateries(oMatries);
                if (msg.Status)
                {
                    PageHelper.ShowAlertMsg(this, "修改材料表成功");
                }
                else
                {
                    PageHelper.ShowAlertMsg(this, msg.Message);
                }
            }
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReturnMsg ret = new ReturnMsg();

            ret.Status = 0;
            this.Response.ContentType = "text/plain";
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string sImei             = this.Request["imei"];
            string Id    = this.Request["username"];
            string table = this.Request["tablename"];

            if (table != null)
            {
                if (table.Equals("Tbl_Materies"))
                {
                    Msg msg = MetriesModel.AndroidEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_ProductBatch"))
                {
                    Msg msg = ProductModel.AndroidInBunch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutProductBatch"))
                {
                    Msg msg = ProductModel.AndroidOutEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_CenterStorageBatch"))
                {
                    Msg msg = Center.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutCenterStorage"))
                {
                    Msg msg = Center.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_SiteStorageBatch"))
                {
                    Msg msg = SiteStorageModel.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutSiteStorage"))
                {
                    Msg msg = SiteStorageModel.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else
                {
                    ret.Status = 0;
                }
            }
            this.Response.Write(jss.Serialize(ret));
        }
예제 #9
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            List <Tbl_Materies> MatriesList = new List <Tbl_Materies>();

            if (checkAll.Checked != false)
            {
                for (int i = 0; i < GridView1.PageCount; i++)
                {
                    if (i != GridView1.PageCount - 1)
                    {
                        List <int> li = new List <int>();
                        for (int j = 1; j <= 10; j++)
                        {
                            li.Add(j);
                        }
                        ViewState["page" + i] = li;
                    }
                    else
                    {
                        List <int> li = new List <int>();

                        int k = 0;
                        if (GridView1.Rows.Count % 10 == 0)
                        {
                            k = 10;
                        }
                        else
                        {
                            k = GridView1.Rows.Count % 10;
                        }
                        for (int j = 1; j <= k; j++)
                        {
                            li.Add(j);
                        }
                        ViewState["page" + i] = li;
                    }
                }
            }
            for (int i = 0; i < GridView1.PageCount; i++)
            {
                if (ViewState["page" + i] != null)
                {
                    List <int> pages = ViewState["page" + i] as List <int>;
                    foreach (int index in pages)
                    {
                        try
                        {
                            int    obj     = i * 10 + index - 1;
                            string sPlanId = this.Request["PlanID"];

                            Tbl_Materies oMatries = new Tbl_Materies();
                            oMatries.PlanID          = int.Parse(sPlanId);
                            oMatries.ProjectName     = txbPlanId.Text;
                            oMatries.TotalNum        = int.Parse(inList[obj].Count.ToString());
                            oMatries.MateriesType    = inList[obj].Num.ToString();
                            oMatries.Date            = DateTime.Now;
                            oMatries.BuildName       = "铝";
                            oMatries.BuildNum        = inList[obj].BuildId;
                            oMatries.NowAdmStatus    = 1;
                            oMatries.NowDate         = DateTime.Now.ToString();
                            oMatries.BeforeAdmStatus = 128;
                            oMatries.PreDate         = DateTime.Now.ToString();
                            oMatries.ProcessingNum   = inList[obj].MapId;
                            MatriesList.Add(oMatries);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
            Msg msg = MetriesModel.AddMateries(MatriesList);

            if (msg.Status)
            {
                PageHelper.ShowAlertMsg(this, "编辑成功");
            }
        }
예제 #10
0
        protected void Ensure_Click(object sender, EventArgs e)
        {
            List <Tbl_Materies> list = new List <Tbl_Materies>();
            string sPlanId           = this.Request["PlanID"];

            if (checkAll.Checked == true)
            {
                for (int i = 0; i < lPlan.Count; i++)
                {
                    Tbl_Materies oMatries = new Tbl_Materies();
                    oMatries.PlanID          = int.Parse(sPlanId);
                    oMatries.ProjectName     = lPlan[i].ProjectName;
                    oMatries.TotalNum        = lPlan[i].TotalNum;
                    oMatries.MateriesType    = lPlan[i].MateriesType;
                    oMatries.Date            = DateTime.Now;
                    oMatries.BuildName       = lPlan[i].BuildName;
                    oMatries.BuildNum        = lPlan[i].BuildNum;
                    oMatries.BeforeAdmStatus = 128;
                    oMatries.PreDate         = DateTime.Now.ToString();
                    oMatries.NowAdmStatus    = 1;
                    oMatries.ProcessingNum   = lPlan[i].ProcessingNum;
                    oMatries.NowDate         = DateTime.Now.ToString();
                    oMatries.MateriesID      = lPlan[i].MateriesID;
                    list.Add(oMatries);
                }
            }
            else
            {
                for (int i = 0; i < GridView1.Rows.Count; i++)
                {
                    if (((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.GridView1.Rows[i].FindControl("chkBox")).Checked == true)
                    {
                        Tbl_Materies oMatries = new Tbl_Materies();
                        oMatries.PlanID          = int.Parse(sPlanId);
                        oMatries.ProjectName     = GridView1.Rows[i].Cells[1].Text;
                        oMatries.TotalNum        = int.Parse(GridView1.Rows[i].Cells[7].Text);
                        oMatries.MateriesType    = GridView1.Rows[i].Cells[6].Text;
                        oMatries.Date            = DateTime.Now;
                        oMatries.BuildName       = GridView1.Rows[i].Cells[4].Text;
                        oMatries.BuildNum        = GridView1.Rows[i].Cells[3].Text;
                        oMatries.BeforeAdmStatus = 128;
                        oMatries.PreDate         = DateTime.Now.ToString();
                        oMatries.NowAdmStatus    = 1;
                        oMatries.ProcessingNum   = GridView1.Rows[i].Cells[5].Text;
                        oMatries.NowDate         = DateTime.Now.ToString();
                        oMatries.MateriesID      = lPlan[i].MateriesID;

                        list.Add(oMatries);
                    }
                }
            }
            Msg msg = MetriesModel.EnsureMateries(list);

            if (msg.Status)
            {
                PageHelper.ShowAlertMsg(this, "确认材料表成功");
            }
            else
            {
                PageHelper.ShowAlertMsg(this, msg.Message);
            }
        }
예제 #11
0
        public string AdmEnsure(string Id, string table)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();

            ////  string sImei = this.Request["imei"];
            //string Id = this.Context.Request.QueryString["id"];
            //string table =this.Context.Request.QueryString["table"];
            if (table != null)
            {
                LingYunDemo.Web.android.AdmEnsure.ReturnMsg ret = new LingYunDemo.Web.android.AdmEnsure.ReturnMsg();
                ret.Status = 1;
                if (table.Equals("Tbl_Materies"))
                {
                    Msg msg = MetriesModel.AndroidEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_ProductBatch"))
                {
                    Msg msg = ProductModel.AndroidInBunch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutProductBatch"))
                {
                    Msg msg = ProductModel.AndroidOutEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_CenterStorageBatch"))
                {
                    Msg msg = Center.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutCenterStorage"))
                {
                    Msg msg = Center.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_SiteStorageBatch"))
                {
                    Msg msg = SiteStorageModel.AndroidInEnsure(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                else if (table.Equals("Tbl_OutSiteStorage"))
                {
                    Msg msg = SiteStorageModel.AndroidOutBatch(int.Parse(Id));
                    if (msg.Status)
                    {
                        ret.Status = 1;
                    }
                }
                //this.Response.Write(jss.Serialize(ret));
                //this.Response.Write("#");
            }
            //this.Context.Response.Write(Id);
            //this.Context.Response.Write(table);
            return(Id);
        }