示例#1
0
        //public ActionResult SaveUpdatePlan()
        //{
        //    tk_Product_Plan task = new tk_Product_Plan();
        //    task.JHID = Request["JHID"].ToString();
        //    task.Specifieddate = Convert.ToDateTime(Request["Specifieddate"]);
        //    task.Plannedmonth = Request["Plannedmonth"].ToString();
        //    task.Remarks = Request["Remarks"].ToString();
        //    task.Formulation = Request["Formulation"].ToString();


        //    string[] arrMain = Request["MainContent"].Split(',');
        //    string[] arrDID = Request["DID"].Split(',');
        //    string[] arrName = Request["Name"].Split(',');
        //    string[] arrSpecifications = Request["Specifications"].Split(',');
        //    string[] arrFinishedproduct = Request["Finishedproduct"].Split(',');
        //    string[] arrfinishingproduct = Request["finishingproduct"].Split(',');
        //    string[] arrfinishingproducts = Request["finishingproducts"].Split(',');
        //    string[] arrnotavailable = Request["notavailable"].Split(',');
        //    string[] arrTotal = Request["Total"].Split(',');
        //    string[] arrplannumber = Request["plannumber"].Split(',');
        //    string[] arrdemandnumber = Request["demandnumber"].Split(',');
        //    string[] arrRemark = Request["Remark"].Split(',');

        //    string strErr = "";
        //    tk_Product_PlanDetail deInfo = new tk_Product_PlanDetail();
        //    List<tk_Product_PlanDetail> detailList = new List<tk_Product_PlanDetail>();
        //    for (int i = 0; i < arrMain.Length; i++)
        //    {
        //        deInfo = new tk_Product_PlanDetail();
        //        deInfo.JHID = Request["JHID"].ToString();
        //        deInfo.DID = arrDID[i].ToString();
        //        deInfo.Name = arrName[i].ToString();
        //        deInfo.Specifications = arrSpecifications[i].ToString();
        //        deInfo.Finishedproduct = Convert.ToInt32(arrFinishedproduct[i]);
        //        deInfo.finishingproduct = Convert.ToInt32(arrfinishingproduct[i]);
        //        deInfo.Spareparts = Convert.ToInt32(arrfinishingproducts[i]);
        //        deInfo.notavailable = Convert.ToInt32(arrnotavailable[i]);
        //        deInfo.Total = Convert.ToInt32(arrTotal[i]);
        //        deInfo.plannumber = Convert.ToInt32(arrplannumber[i]);
        //        deInfo.demandnumber = Convert.ToInt32(arrdemandnumber[i]);
        //        deInfo.Remarks = arrRemark[i].ToString();

        //        detailList.Add(deInfo);
        //    }
        //    var JHID = Request["JHID"].ToString();
        //    bool b = ProduceMan.SaveUpdatePlan(task, detailList, ref strErr, JHID);
        //    if (b)
        //    {
        //        #region [添加日志]
        //        tk_ProLog log = new tk_ProLog();
        //        log.LogTime = DateTime.Now;
        //        log.YYCode = Request["JHID"].ToString();
        //        log.YYType = "修改成功 ";
        //        log.Content = "修改计划单";
        //        log.Actor = GAccount.GetAccountInfo().UserName;
        //        log.Unit = GAccount.GetAccountInfo().UnitName;
        //        ProduceMan.AddProduceLog(log);
        //        #endregion
        //        return Json(new { success = true });
        //    }
        //    else
        //    {
        //        #region [添加日志]
        //        tk_ProLog log = new tk_ProLog();
        //        log.LogTime = DateTime.Now;
        //        log.YYCode = Request["JHID"].ToString();
        //        log.YYType = "修改失败 ";
        //        log.Content = "修改计划单";
        //        log.Actor = GAccount.GetAccountInfo().UserName;
        //        log.Unit = GAccount.GetAccountInfo().UnitName;
        //        ProduceMan.AddProduceLog(log);
        //        #endregion
        //        return Json(new { success = false, Msg = strErr });
        //    }
        //}
        #endregion
        #endregion

        #region 撤销计划单
        #region 撤销
        public ActionResult CXJH()
        {
            string strErr = "";
            string JHID   = Request["JHID"].ToString();

            if (ProduceMan.CXJH(JHID, ref strErr))
            {
                #region [添加日志]
                tk_ProLog log = new tk_ProLog();
                log.LogTime = DateTime.Now;
                log.YYCode  = JHID;
                log.YYType  = "撤销成功 ";
                log.Content = "撤销计划";
                log.Actor   = GAccount.GetAccountInfo().UserName;
                log.Unit    = GAccount.GetAccountInfo().UnitName;
                ProduceMan.AddProduceLog(log);
                #endregion
                return(Json(new { success = "true", Msg = "撤销成功" }));
            }
            else
            {
                #region [添加日志]
                tk_ProLog log = new tk_ProLog();
                log.LogTime = DateTime.Now;
                log.YYCode  = JHID;
                log.YYType  = "撤销失败 ";
                log.Content = "撤销计划";
                log.Actor   = GAccount.GetAccountInfo().UserName;
                log.Unit    = GAccount.GetAccountInfo().UnitName;
                ProduceMan.AddProduceLog(log);
                #endregion
                return(Json(new { success = "false", Msg = strErr }));
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult AptitudeUserGrid()
        {
            Acc_Account account = GAccount.GetAccountInfo();

            string where = " and a.Unit = '" + account.UnitID + "'";
            string strCurPage;
            string strRowNum;
            string UserName = Request["userName"].ToString();

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (UserName != "")
            {
                where += " and b.UserName like '%" + UserName + "%'";
            }
            UIDataTable udtTask = UserAptitudeMan.getNewAptitudeUserGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="Uaptitude"></param>
        /// <returns></returns>
        public ActionResult InsertUserAptitude(UserAptitude Uaptitude)
        {
            Acc_Account account = GAccount.GetAccountInfo();

            Uaptitude.StrCreateUser = account.UserID.ToString();
            Uaptitude.StrCreateTime = DateTime.Now;
            Uaptitude.StrValidate   = "v";
            Uaptitude.StrUnit       = account.UnitID;
            HttpPostedFileBase file = Request.Files[0];

            byte[] fileByte = new byte[0];
            if (file.FileName != "")
            {
                Uaptitude.StrFileName = file.FileName.Substring(file.FileName.LastIndexOf('\\') + 1);
                int fileLength = file.ContentLength;
                if (fileLength != 0)
                {
                    fileByte = new byte[fileLength];
                    file.InputStream.Read(fileByte, 0, fileLength);
                }
            }
            string strErr = "";

            if (UserAptitudeMan.InsertNewUserAptitude(Uaptitude, fileByte, ref strErr) == true)
            {
                ViewData["msg"] = "保存成功";
                return(View("AddAptitude", Uaptitude));
            }
            else
            {
                ViewData["msg"] = "保存失败";
                return(View("AddAptitude", Uaptitude));
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="Uaptitude"></param>
        /// <returns></returns>
        public ActionResult UpDataUserAptitude(UserAptitude Uaptitude)
        {
            var                ID      = Request["ID"];
            Acc_Account        account = GAccount.GetAccountInfo();
            HttpPostedFileBase file    = Request.Files[0];

            byte[] fileByte = new byte[0];
            if (file.FileName != "")
            {
                Uaptitude.StrFileName = file.FileName.Substring(file.FileName.LastIndexOf('\\') + 1);
                int fileLength = file.ContentLength;
                if (fileLength != 0)
                {
                    fileByte = new byte[fileLength];
                    file.InputStream.Read(fileByte, 0, fileLength);
                }
            }
            string strErr = "";

            if (UserAptitudeMan.UpdateNewUserAptitude(ID, Uaptitude, fileByte, ref strErr) == true)
            {
                ViewData["ID"]  = ID;
                ViewData["msg"] = "保存成功";
                return(View("UpdateAptitude", Uaptitude));
            }
            else
            {
                ViewData["msg"] = "保存失败";
                return(View("UpdateAptitude", Uaptitude));
            }
        }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Bas"></param>
 /// <returns></returns>
 public ActionResult InsertContractBas(ContractBas Bas)
 {
     if (ModelState.IsValid)
     {
         Acc_Account account = GAccount.GetAccountInfo();
         Bas.StrUnit       = account.UnitID.ToString();
         Bas.StrCID        = ContractMan.GetNewCID();
         Bas.StrCreateTime = DateTime.Now;
         Bas.StrCreateUser = account.UserID.ToString();
         Bas.StrValidate   = "v";
         string strErr = "";
         if (ContractMan.InsertNewContractBas(Bas, ref strErr) == true)
         {
             return(Json(new { success = "true", Msg = "保存成功" }));
         }
         else
         {
             return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
         }
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = "false", Msg = "数据验证不通过" }));
     }
 }
示例#6
0
        public ActionResult SelectProduct()
        {
            var         ProductName = Request["data1"];
            Acc_Account account     = GAccount.GetAccountInfo();
            string      UnitID      = account.UnitID;
            DataTable   dt          = COM_ApprovalMan.getNewProductByName(ProductName, UnitID);
            string      name        = "";
            string      spc         = "";
            string      pid         = "";
            string      units       = "";

            string unitprice = "";
            string price2    = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                name  += dt.Rows[i]["ProName"] + "$";
                spc   += dt.Rows[i]["Spec"] + "$";
                pid   += dt.Rows[i]["PID"] + "$";
                units += dt.Rows[i]["Units"] + "$";

                unitprice += dt.Rows[i]["UnitPrice"] + "$";
                price2    += dt.Rows[i]["Price2"] + "$";
            }
            name = name.TrimEnd('$');
            //spc = spc.TrimEnd('$');
            spc   = spc.Remove(spc.LastIndexOf("$"), 1);
            pid   = pid.TrimEnd('$');
            units = units.TrimEnd('$');

            unitprice = unitprice.TrimEnd('$');
            price2    = price2.TrimEnd('$');
            return(Json(new { success = "true", Strname = name, Strspc = spc, Stpid = pid, strunits = units, Strunitprice = unitprice, Strprice2 = price2 }));
        }
示例#7
0
        public ActionResult InsertContractFile()
        {
            //获取上传的文件
            HttpFileCollection Filedata = System.Web.HttpContext.Current.Request.Files;

            // 如果没有上传文件
            if (Filedata == null || Filedata.Count == 0 || Filedata[0].ContentLength == 0)
            {
                return(this.HttpNotFound());
            }
            else
            {
                ContractBas Bas = new ContractBas();
                Bas.StrCID        = Request["PID"].ToString();
                Bas.StrCreateTime = DateTime.Now;
                Acc_Account account = GAccount.GetAccountInfo();
                Bas.StrCreateUser = account.UserID.ToString();
                Bas.StrValidate   = "v";
                string strErr = "";
                if (ProjectMan.InsertNewContratFile(Bas, Filedata, ref strErr) == true)
                {
                    return(Json(new { success = "true", Msg = "保存成功" }));
                }
                else
                {
                    return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
                }
            }
        }
示例#8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult StandingBookGrid()
        {
            Acc_Account account = GAccount.GetAccountInfo();
            string      unit    = account.UnitID.ToString();

            string where = " and a.UnitID = '" + unit + "'";
            string strCurPage;
            string strRowNum;
            string TracingType  = Request["TracingType"].ToString();
            string CheckCompany = Request["CheckCompany"].ToString();
            string StarTime     = Request["starTime"].ToString();
            string EndTime      = Request["endTime"].ToString();
            string OrderDate    = "";

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (TracingType != "")
            {
                where += " and b.CheckWay = '" + TracingType + "'";
            }
            if (CheckCompany != "")
            {
                where += " and a.CheckCompany like '%" + CheckCompany + "%'";
            }
            if (StarTime != "")
            {
                where += " and b.CheckDate >= '" + StarTime + "' and b.CheckDate <= '" + EndTime + "' ";
            }
            string Order = " order by m.ControlCode";

            if (Request["OrderDate"] != null)
            {
                OrderDate = Request["OrderDate"].ToString();
            }
            if (OrderDate != "")
            {
                string[] arrLast = OrderDate.Split('@');
                Order = " order by m." + arrLast[0] + " " + arrLast[1] + "";
            }
            UIDataTable udtTask = EquipMan.getNewStandingBookGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, Order);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
示例#9
0
        public ActionResult ProductPlanAdd()
        {
            tk_Product_Plan si = new TECOCITY_BGOI.tk_Product_Plan();

            si.JHID        = ProduceMan.GetTopJHID();
            si.Formulation = GAccount.GetAccountInfo().UserName;
            return(View(si));
        }
示例#10
0
        public ActionResult SelectModule()
        {
            Acc_Account account = GAccount.GetAccountInfo();

            ViewData["Role"]   = account.UserRole;
            ViewData["UserID"] = account.UserID.ToString();
            return(View());
        }
示例#11
0
 /// <summary>
 /// 可以
 /// </summary>
 /// <returns></returns>
 public ActionResult ContractGrid(tk_ContractSearch ContractSearch)
 {
     if (ModelState.IsValid)
     {
         string where = "";
         Acc_Account account = GAccount.GetAccountInfo();
         string      unit    = account.UnitID.ToString();
         if (unit == "32" || unit == "46")
         {
             where += "";
         }
         else
         {
             where += " and a.Unit = '" + unit + "'";
         }
         if (account.UserRole == "3")
         {
             where += " and a.BusinessType = 'BT5'";
         }
         string strCurPage;
         string strRowNum;
         string Cname      = ContractSearch.Cname;
         string ContractID = ContractSearch.ContractID;
         if (Request["curpage"] != null)
         {
             strCurPage = Request["curpage"].ToString();
         }
         if (Request["rownum"] != null)
         {
             strRowNum = Request["rownum"].ToString();
         }
         else
         {
             strRowNum = "10";
         }
         if (Cname != "" && Cname != null)
         {
             where += " and a.Cname like '%" + Cname + "%'";
         }
         if (ContractID != "" && ContractID != null)
         {
             where += " and a.ContractID like '%" + ContractID + "%'";
         }
         UIDataTable udtTask = ContractMan.getNewContractGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
         string      strjson = GFun.Dt2Json("", udtTask.DtData);
         strjson = strjson.Substring(1);
         strjson = strjson.Substring(0, strjson.Length - 1);
         string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";
         jsonData += strjson + "}";
         return(Json(jsonData, JsonRequestBehavior.AllowGet));
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = false, Msg = "查询条件验证不通过" }));
     }
 }
示例#12
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public ActionResult StayReturnCashGrid(tk_ContractSearch ContractSearch)
 {
     if (ModelState.IsValid)
     {
         Acc_Account account = GAccount.GetAccountInfo();
         string      unit    = account.UnitID.ToString();
         string where = "";
         string time = ContractMan.getNewReturnTime();
         if (time == "")
         {
             where = " and a.Unit = '" + unit + "' and a.state != '2' and DATEDIFF(MONTH,GETDATE(),a.CPlanEndTime) <= '2'";
         }
         else
         {
             where = " and a.Unit = '" + unit + "' and a.state != '2' and DATEDIFF(MONTH,GETDATE(),a.CPlanEndTime) <= '" + time + "'";
         }
         string strCurPage;
         string strRowNum;
         //string PayOrIncome = Request["payOrIncome"].ToString();
         string Cname      = ContractSearch.Cname;
         string ContractID = ContractSearch.ContractID;
         if (Request["curpage"] != null)
         {
             strCurPage = Request["curpage"].ToString();
         }
         if (Request["rownum"] != null)
         {
             strRowNum = Request["rownum"].ToString();
         }
         else
         {
             strRowNum = "10";
         }
         //if (PayOrIncome != "")
         //    where += " and a.PayOrIncome = '" + PayOrIncome + "'";
         if (Cname != "" && Cname != null)
         {
             where += " and a.Cname like '%" + Cname + "%'";
         }
         if (ContractID != "" && ContractID != null)
         {
             where += " and a.ContractID = '" + ContractID + "'";
         }
         UIDataTable udtTask = ContractMan.getNewContractGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where);
         string      strjson = GFun.Dt2Json("", udtTask.DtData);
         strjson = strjson.Substring(1);
         strjson = strjson.Substring(0, strjson.Length - 1);
         string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";
         jsonData += strjson + "}";
         return(Json(jsonData, JsonRequestBehavior.AllowGet));
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = false, Msg = "查询条件验证不通过" }));
     }
 }
示例#13
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult AptitudeWarnGrid()
        {
            string where = "";
            Acc_Account account = GAccount.GetAccountInfo();

            where = " and a.Unit = '" + account.UnitID + "'";
            string num = UserAptitudeMan.getNewAptitudeTime();

            if (num == "")
            {
                where += " and DATEDIFF(MONTH,GETDATE(),a.CertificatDate) <= '2'";
            }
            else
            {
                where += "  and DATEDIFF(MONTH,GETDATE(),a.CertificatDate) <= '" + num + "'";
            }
            string strCurPage;
            string strRowNum;
            string UserName     = Request["userName"].ToString();
            string BusinessType = Request["businessType"].ToString();
            string TecoName     = Request["tecoName"].ToString();

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (UserName != "")
            {
                where += " and a.UserName like '%" + UserName + "%'";
            }
            if (BusinessType != "")
            {
                where += " and a.BusinessType = '" + BusinessType + "'";
            }
            if (TecoName != "")
            {
                where += " and a.TecoName like '%" + TecoName + "%'";
            }
            UIDataTable udtTask = UserAptitudeMan.getNewAptitudeGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, account.UnitID);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
示例#14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult TracingGrid()
        {
            Acc_Account account = GAccount.GetAccountInfo();
            string      unit    = account.UnitID.ToString();

            string where = " and a.UnitID = '" + unit + "'";
            string strCurPage;
            string strRowNum;
            string XStarTime = Request["xstarTime"].ToString();
            string XEndTime  = Request["xendTime"].ToString();
            string JStarTime = Request["JStarTime"].ToString();
            string JEndTime  = Request["JEndTime"].ToString();
            string OrderDate = "";

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (XStarTime != "")
            {
                where += " and a.LastDate >= '" + XStarTime + "' and a.LastDate <= '" + XEndTime + "' ";
            }
            if (JStarTime != "")
            {
                where += " and a.PlanDate >= '" + JStarTime + "' and a.PlanDate <= '" + JEndTime + "' ";
            }
            string Order = " order by m.ControlCode";

            if (Request["OrderDate"] != null)
            {
                OrderDate = Request["OrderDate"].ToString();
            }
            if (OrderDate != "")
            {
                string[] arrLast = OrderDate.Split('@');
                Order = " order by m." + arrLast[0] + " " + arrLast[1] + "";
            }

            UIDataTable udtTask = EquipMan.getNewTracingGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, Order);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
示例#15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult EquipWarnGrid()
        {
            Acc_Account account = GAccount.GetAccountInfo();
            string      unit    = account.UnitID.ToString();

            string where = " and a.state != '-1' and a.UnitID = '" + unit + "'";
            string ck1 = EquipMan.getNewCK1time();

            if (ck1 != "")
            {
                where += " and (DATEDIFF(MONTH,GETDATE(),a.PlanDate)) <= '" + ck1 + "'";
            }
            else
            {
                where += " and (DATEDIFF(MONTH,GETDATE(),a.PlanDate)) <= '2'";
            }

            string strCurPage;
            string strRowNum;
            string OrderDate = "";

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            string Order = " order by m.ControlCode";

            if (Request["OrderDate"] != null)
            {
                OrderDate = Request["OrderDate"].ToString();
            }
            if (OrderDate != "")
            {
                string[] arrLast = OrderDate.Split('@');
                Order = " order by m." + arrLast[0] + " " + arrLast[1] + "";
            }
            UIDataTable udtTask = EquipMan.getNewEquipGrid(GFun.SafeToInt32(strRowNum), GFun.SafeToInt32(Request["curpage"]) - 1, where, Order, unit);
            string      strjson = GFun.Dt2Json("", udtTask.DtData);

            strjson = strjson.Substring(1);
            strjson = strjson.Substring(0, strjson.Length - 1);
            string jsonData = "{ \"page\":" + GFun.SafeToInt32(Request["curpage"]) + ", \"total\": " + udtTask.IntTotalPages + ", \"records\": " + udtTask.IntRecords + ", \"rows\": ";

            jsonData += strjson + "}";
            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
示例#16
0
        // 审批流程控制审批按钮可用不可用
        public ActionResult JudgeAppDisable()
        {
            var         webkey     = Request["data1"];
            var         SPID       = Request["data2"];
            Acc_Account account    = GAccount.GetAccountInfo();
            string      logUser    = account.UserID.ToString();
            string      folderBack = COM_ApprovalMan.getNewwebkey(webkey);
            int         bol        = COM_ApprovalMan.JudgeNewLoginUser(logUser, webkey, folderBack, SPID);

            return(Json(new { success = "true", intblo = bol }));
        }
示例#17
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult ToExcelStanding()
        {
            Acc_Account account  = GAccount.GetAccountInfo();
            string      unit     = account.UnitID.ToString();
            string      UnitName = account.UnitName;

            string where = " and a.UnitID = '" + unit + "'";
            string TracingType  = Request["TracingType"].ToString();
            string CheckCompany = Request["CheckCompany"].ToString();
            string StarTime     = Request["starTime"].ToString();
            string EndTime      = Request["endTime"].ToString();
            string Order        = Request["Order"].ToString();
            string whereOrder   = "";

            if (TracingType != "")
            {
                where += " and b.CheckWay = '" + TracingType + "'";
            }
            if (CheckCompany != "")
            {
                where += " and a.CheckCompany like '%" + CheckCompany + "%'";
            }
            if (StarTime != "")
            {
                where += " and b.CheckDate >= '" + StarTime + "' and b.CheckDate <= '" + EndTime + "' ";
            }
            if (Order == "")
            {
                whereOrder = " order by m.ControlCode";
            }
            else
            {
                string[] arrLast = Order.Split('@');
                whereOrder = " order by m." + arrLast[0] + " " + arrLast[1] + "";
            }
            DataTable data = EquipMan.getNewPrintStanding(where, whereOrder);

            if (data != null)
            {
                string strCols = "序号-2000,控制编号-5000,名称-5000,生产厂家-7000,检定单位-7000,出厂编号-7000,规格型号-5000,精度-5000,以检日期-5000,周期-3000,方式-3000,费用-3000";
                data.Columns["xu"].SetOrdinal(0);
                System.IO.MemoryStream stream = ExcelHelper.ExportDataTableToExcel(data, UnitName + "-仪器设备一览表", strCols.Split(','));
                stream.Seek(0, System.IO.SeekOrigin.Begin);
                return(File(stream, "application/vnd.ms-excel", "Info.xls"));
            }
            else
            {
                return(null);
            }
        }
示例#18
0
        public ActionResult ValidateJudge()
        {
            Acc_Account account  = GAccount.GetAccountInfo();
            string      UserId   = account.UserID.ToString();
            string      validate = MainMan.judgeNewValidate(UserId);

            if (validate != "")
            {
                return(Json(new { success = "true", Msg = validate }));
            }
            else
            {
                return(Json(new { success = "false" }));
            }
        }
示例#19
0
        public ActionResult ToExcel()
        {
            Acc_Account account  = GAccount.GetAccountInfo();
            string      unit     = account.UnitID.ToString();
            string      unitName = account.UnitName;

            string where = " and a.Unit = '" + unit + "'";
            string strCurPage;
            string strRowNum;
            string Cname      = Request["cname"].ToString();
            string ContractID = Request["contractID"].ToString();
            string year       = DateTime.Now.ToString("yyyy");

            if (Request["curpage"] != null)
            {
                strCurPage = Request["curpage"].ToString();
            }
            if (Request["rownum"] != null)
            {
                strRowNum = Request["rownum"].ToString();
            }
            else
            {
                strRowNum = "10";
            }
            if (Cname != "")
            {
                where += " and a.Cname like '%" + Cname + "%'";
            }
            if (ContractID != "")
            {
                where += " and a.ContractID like '%" + ContractID + "%'";
            }
            DataTable data = ContractMan.getNewPrintStandingBook(where);

            if (data != null)
            {
                string strCols = "序号-2000,合同编号-5000,合同名称-5000,内容-5000,签署日期-5000,甲方单位-7000,乙方单位-7000,合同金额-5000,页数-5000,经办人-5000,备注-7000";
                data.Columns["xu"].SetOrdinal(0);
                System.IO.MemoryStream stream = ExcelHelper.ExportDataTableToExcel(data, year + "年" + unitName + "合同管理台账", strCols.Split(','));
                stream.Seek(0, System.IO.SeekOrigin.Begin);
                return(File(stream, "application/vnd.ms-excel", "Info.xls"));
            }
            else
            {
                return(null);
            }
        }
示例#20
0
        //这里的方法需要验证登录状态,以下雷同
        public ActionResult Main(string id)
        {
            //var Url = Request["Url"];
            //ViewData["Url"] = Url;
            ViewData["Role"] = id;
            Acc_Account account = GAccount.GetAccountInfo();

            //ViewData["Role"] = account.UserRole;
            ViewData["UserName"] = account.UserName;
            ViewData["Unit"]     = account.UnitName;
            //领导审批提示
            ViewData["UserId"]    = account.UserID;
            ViewData["ExJob"]     = account.Exjob;
            ViewData["RoleNames"] = account.RoleNames;
            return(View());
        }
示例#21
0
        public FileResult ToTracingExcel()
        {
            Acc_Account account  = GAccount.GetAccountInfo();
            string      unit     = account.UnitID.ToString();
            string      UnitName = account.UnitName;

            string where = " and a.UnitID = '" + unit + "'";
            string XStarTime  = Request["xstarTime"].ToString();
            string XEndTime   = Request["xendTime"].ToString();
            string JStarTime  = Request["JStarTime"].ToString();
            string JEndTime   = Request["JEndTime"].ToString();
            string Order      = Request["Order"].ToString();
            string whereOrder = "";
            string year       = DateTime.Now.ToString("yyyy");

            if (XStarTime != "")
            {
                where += " and a.LastDate >= '" + XStarTime + "' and a.LastDate <= '" + XEndTime + "' ";
            }
            if (JStarTime != "")
            {
                where += " and a.PlanDate >= '" + JStarTime + "' and a.PlanDate <= '" + JEndTime + "' ";
            }
            if (Order == "")
            {
                whereOrder = " order by m.ControlCode";
            }
            else
            {
                string[] arrLast = Order.Split('@');
                whereOrder = " order by m." + arrLast[0] + " " + arrLast[1] + "";
            }
            DataTable data = EquipMan.getNewPintTracing(where, whereOrder);

            if (data != null)
            {
                string strCols = "序号-2000,设备名称-5000,控制编号-5000,规格型号-7000,制造商-7000,校准服务机构-10000,校准周期-5000,上次校准时间-5000,计划校准时间-5000,结果-3000,负责人-3000";
                data.Columns["xu"].SetOrdinal(0);
                System.IO.MemoryStream stream = ExcelHelper.ExportDataTableToExcel(data, year + "年度仪器设备溯源计划表", strCols.Split(','));
                stream.Seek(0, System.IO.SeekOrigin.Begin);
                return(File(stream, "application/vnd.ms-excel", "Info.xls"));
            }
            else
            {
                return(null);
            }
        }
示例#22
0
        public ActionResult SavePwd()
        {
            string      OldPwd  = Request["OldPwd"].ToString();
            string      NewPwd  = Request["NewPwd"].ToString();
            Acc_Account account = GAccount.GetAccountInfo();
            int         UserId  = account.UserID;
            string      err     = "";

            if (MainMan.UpdatePwd(OldPwd, NewPwd, UserId, ref err))
            {
                return(Json(new { success = "true", Msg = err }));
            }
            else
            {
                return(Json(new { success = "false", Msg = err }));
            }
        }
示例#23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Scrap"></param>
        /// <returns></returns>
        public ActionResult InsertDScrapInfo(DScrapInfo Scrap)
        {
            Acc_Account account = GAccount.GetAccountInfo();

            Scrap.StrCreateUser = account.UserID.ToString();
            Scrap.StrCreateTime = DateTime.Now;
            string strErr = "";

            if (EquipMan.InsertNewDScrapInfo(Scrap, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
示例#24
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="num"></param>
        /// <returns></returns>
        public ActionResult InsertConfigTime(string num)
        {
            string      checkWay = "CK";
            string      TimeType = "Device";
            Acc_Account account  = GAccount.GetAccountInfo();
            string      unit     = account.UnitID.ToString();
            string      strErr   = "";

            if (EquipMan.InsertNewCongTime(checkWay, num, unit, TimeType, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
示例#25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Lend"></param>
        /// <returns></returns>
        public ActionResult InsertLendAptitude(UCertificatLend Lend)
        {
            Acc_Account account = GAccount.GetAccountInfo();

            Lend.StrCreateUser = account.UserID.ToString();
            Lend.StrCreateTime = DateTime.Now;
            Lend.StrValidate   = "v";
            string strErr = "";

            if (UserAptitudeMan.InsertNewLendAptitude(Lend, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存失败" + "/" + strErr }));
            }
        }
示例#26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Rsource"></param>
        /// <returns></returns>
        public ActionResult InsertRativeSource(RativeSource Rsource)
        {
            Acc_Account account = GAccount.GetAccountInfo();

            Rsource.StrCreateUser = account.UserID.ToString();
            Rsource.StrCreateTime = DateTime.Now;
            Rsource.StrValidate   = "v";
            string strErr = "";

            if (EquipMan.InsertNewRativeSource(Rsource, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
示例#27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Bas"></param>
        /// <returns></returns>
        public ActionResult InsertDeviceBas(DevicsBas Bas)
        {
            Acc_Account account = GAccount.GetAccountInfo();

            Bas.StrUnitID     = account.UnitID;
            Bas.StrCreateTime = DateTime.Now;
            Bas.StrCreateUser = account.UserID.ToString();
            Bas.StrValidate   = "v";
            Bas.StrIsCycle    = 1;
            string strErr = "";

            if (EquipMan.InsertNewDeviceBas(Bas, ref strErr) == true)
            {
                return(Json(new { success = "true", Msg = "保存成功" }));
            }
            else
            {
                return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
            }
        }
示例#28
0
        public ActionResult getProduct()
        {
            Acc_Account account = GAccount.GetAccountInfo();
            string      UnitID  = account.UnitID;
            DataTable   dt      = COM_ApprovalMan.getNewProductByUnitID(UnitID);

            if (dt == null || dt.Rows.Count == 0)
            {
                return(Json(new { success = "false", Msg = "无数据" }));
            }
            //string id = "";
            string name = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                //id += dt.Rows[i]["PID"].ToString() + ",";
                name += dt.Rows[i]["ProName"].ToString() + ",";
            }
            //id = id.TrimEnd(',');
            name = name.TrimEnd(',');
            return(Json(new { success = "true", Strname = name }));
        }
示例#29
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="CST"></param>
 /// <returns></returns>
 public ActionResult InsertSettlement(CSettlement CST)
 {
     if (ModelState.IsValid)
     {
         Acc_Account account = GAccount.GetAccountInfo();
         CST.StrCreateUser = account.UserID.ToString();
         CST.StrCreateTime = DateTime.Now;
         string strErr = "";
         if (ContractMan.InsertNewSettlement(CST, ref strErr) == true)
         {
             return(Json(new { success = "true", Msg = "保存成功" }));
         }
         else
         {
             return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
         }
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = "false", Msg = "数据验证不通过" }));
     }
 }
示例#30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Cash"></param>
 /// <returns></returns>
 public ActionResult InsertCCashBack(CCashBack Cash)
 {
     if (ModelState.IsValid)
     {
         Cash.StrCreateTime = DateTime.Now;
         Acc_Account account = GAccount.GetAccountInfo();
         Cash.StrCreateUser = account.UserID.ToString();
         Cash.StrValidate   = "v";
         string strErr = "";
         if (ContractMan.InsertNewCCashBack(Cash, ref strErr) == true)
         {
             return(Json(new { success = "true", Msg = "保存成功" }));
         }
         else
         {
             return(Json(new { success = "false", Msg = "保存出错" + "/" + strErr }));
         }
     }
     else
     {
         //如果有错误,继续输入信息
         return(Json(new { success = "false", Msg = "数据验证不通过" }));
     }
 }