private string SeeClickPhoto(T_UserClick Uclick, long id)
        {
            if (Uclick == null)
            {
                //如果没有添加一条用户点击信息
                T_UserClick tucs = new T_UserClick();
                tucs.UserInfoId     = LoginUser.ID;
                tucs.ThisClick      = 1;
                tucs.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                T_UserClickService.AddEntity(tucs);
            }
            else
            {
                DateTime logintime = Convert.ToDateTime(Uclick.LoginClickTime);
                if (logintime.ToString("yyyy-MM-dd") == MvcApplication.GetT_time().ToString("yyyy-MM-dd"))
                {
                    Uclick.ThisClick = Uclick.ThisClick + 1;
                    T_UserClickService.EditEntity(Uclick);
                }
                else if (logintime < MvcApplication.GetT_time())
                {
                    Uclick.ThisClick      = 1;
                    Uclick.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                    T_UserClickService.EditEntity(Uclick);
                }
            }
            T_SeeClickPhoto tsc = new T_SeeClickPhoto();

            tsc.UserID  = LoginUser.ID;
            tsc.T_FgjID = id;
            T_SeeClickPhotoService.AddEntity(tsc);
            Common.MemcacheHelper.SetClickMCH(LoginUser.ID.ToString());
            return("OK");
        }
        //追加备注信息
        public ActionResult AddZhuiJia()
        {
            long?  id    = int.Parse(Request["PID"]);
            string bak   = Request["Bak"];
            var    zjbak = T_ZhuaiJiaBakService.LoadEntities(x => x.FGJHTML_id == id).FirstOrDefault();

            //如果空那么新增信息
            if (zjbak == null)
            {
                T_ZhuaiJiaBak newT = new T_ZhuaiJiaBak();
                newT.ADDtime    = MvcApplication.GetT_time();
                newT.AddUser    = LoginUser.ID;
                newT.BAK        = bak;
                newT.DEL        = 0;
                newT.FGJHTML_id = id;
                T_ZhuaiJiaBakService.AddEntity(newT);
                return(Json(new { ret = "ok", msg = "添加成功!" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                zjbak.ADDtime = MvcApplication.GetT_time();
                zjbak.BAK     = bak;
                if (T_ZhuaiJiaBakService.EditEntity(zjbak))
                {
                    return(Json(new { ret = "ok", msg = "修改成功!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { ret = "no", msg = "修改失败,请联系管理员!" }, JsonRequestBehavior.AllowGet));
                }
            }
        }
Example #3
0
        public ActionResult editMoney()
        {
            var rID     = Convert.ToInt64(Request["resultId"]);
            var eMoney  = Request["finalRusult"];
            var eYunfei = Request["Yunfei"];
            var baojia  = YXB_BaojiaService.LoadEntities(x => x.id == rID).FirstOrDefault();

            //检查更改金额之前是否存在值
            if (baojia.BaoJiaMoney == null)
            {
                baojia.BaoJiaMoney  = Convert.ToDecimal(eMoney);
                baojia.BaoJiaYunFei = Convert.ToDecimal(eYunfei);
                baojia.BaoJiaPerson = LoginUser.ID;
                baojia.BaoJiaTime   = MvcApplication.GetT_time();
                baojia.ZhuangTai    = 1;
                YXB_BaojiaService.EditEntity(baojia);
            }
            else
            {
                baojia.EditQianMoney  = baojia.BaoJiaMoney;
                baojia.EditQianYunFei = baojia.BaoJiaYunFei;
                baojia.UpdataTime     = MvcApplication.GetT_time();
                baojia.UpdataUserID   = LoginUser.ID;
                baojia.BaoJiaMoney    = Convert.ToDecimal(eMoney);
                baojia.BaoJiaYunFei   = Convert.ToDecimal(eYunfei);
                baojia.ZhuangTai      = 1;
                YXB_BaojiaService.EditEntity(baojia);
            }


            return(Json(new { ret = true }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        //信息完成处理
        public ActionResult WinChuLi(T_WinBak Twbak)
        {
            //  var WinMoney = Request["WinMoney"]==null?0:Request["WinMoney"].ToString().Trim().Length<=0?0:Convert.ToDecimal(Request["WinMoney"]);

            var Baojia            = YXB_BaojiaService.LoadEntities(x => x.BaoJiaTop_id == Twbak.BaoJiaTOPID).DefaultIfEmpty();
            List <YXB_Baojia> ybj = new List <YXB_Baojia>();

            foreach (var it in Baojia)
            {
                it.WinMoney  = Convert.ToDecimal(Request["EidtMoney" + it.id]);
                it.WinYunFei = Convert.ToDecimal(Request["EidtYunFei" + it.id]);
                it.WIN       = 1;
                //修改完成报价信息
                ybj.Add(it);
            }

            Twbak.AddPerson = LoginUser.ID;
            Twbak.AddTime   = MvcApplication.GetT_time();
            if (T_WinBakService.UpHeTongWinADD(ybj, Twbak))
            {
                return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { ret = "no" }, JsonRequestBehavior.AllowGet));
            }
        }
 //添加或修改报销数据列表
 public ActionResult AddOrEditBxlistBill(T_BaoxiaoItems jkb)
 {
     if (jkb.ID <= 0)
     {
         if (T_BaoxiaoItemsService.LoadEntities(x => x.BaoXiaoID == jkb.BaoXiaoID && x.Del == 0).Count() >= 5)
         {
             return(Json(new { ret = "no", msg = "单据条数上线不可添加!" }, JsonRequestBehavior.AllowGet));
         }
         jkb.AddTime = MvcApplication.GetT_time();
         //int index = jkb.BaoXiaoName.IndexOf("(");
         //jkb.BaoXiaoName = jkb.BaoXiaoName.Remove(index);
         jkb.Del = 0;
         T_BaoxiaoItemsService.AddEntity(jkb);
         return(Json(new { ret = "ok", msg = "添加成功!" }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         if (T_BaoxiaoItemsService.EditEntity(jkb))
         {
             return(Json(new { ret = "ok", msg = "修改成功!" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { msg = "修改出错,联系管理员!" }, JsonRequestBehavior.AllowGet));
         }
     }
 }
        //搜索小秘书  新增数据
        public ActionResult addseach(ScrherSAVE ssave)
        {
            ssave.addUserID = LoginUser.ID;
            ssave.DEL       = 0;
            if (ssave.ID > 0)
            {
                //修改
                ssave.Edittime = MvcApplication.GetT_time();

                bool bl = ScrherSAVEService.EditEntity(ssave);
                if (bl)
                {
                    addsechmishu(ssave);
                }
                return(Json("okedit", JsonRequestBehavior.AllowGet));
            }
            else
            {
                //新增
                ssave.Addtime = MvcApplication.GetT_time();
                ssave         = ScrherSAVEService.AddEntity(ssave);
                addsechmishu(ssave);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
        }
Example #7
0
        public ActionResult WxLogin()
        {
            WxUser wu = new WxUser();

            wu.Wxidcode   = Request["Wxidcode"];
            wu.wxName     = Request["wxName"];
            wu.Wxprovince = Request["Wxprovince"];
            wu.Wxcity     = Request["Wxcity"];
            wu.WxImg      = Request["WxImg"];
            wu.Wxgender   = Convert.ToInt16(Request["Wxgender"]);
            wu.AddTime    = MvcApplication.GetT_time();
            wu.Del        = false;
            wu.Wx_id      = Request["Wx_id"];
            int    Cot = WxUserService.LoadEntities(x => x.Wx_id == wu.Wx_id).Count();
            string ret = "n";

            if (Cot <= 0)
            {
                try
                {
                    WxUserService.AddEntity(wu);
                    ret = "y";
                }
                catch {
                }
            }
            return(Json(new { Wxidcode = wu, T = ret }, JsonRequestBehavior.AllowGet));
        }
        //软删除报销凭证
        public ActionResult DelBxlistbill()
        {
            var id = Request["DelID"] == null ? 0 : Convert.ToInt32(Request["DelID"]);

            if (id == 0)
            {
                return(Json(new { msg = "ID错误!" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var temp = T_BaoxiaoItemsService.LoadEntities(x => x.ID == id).FirstOrDefault();
                if (Convert.ToDateTime(temp.AddTime).ToString("yyyy-MM-dd") != MvcApplication.GetT_time().ToString("yyyy-MM-dd"))
                {
                    return(Json(new { msg = "过期删除,只可删除当天创建信息!" }, JsonRequestBehavior.AllowGet));
                }
                if (temp == null)
                {
                    return(Json(new { msg = "查询的数据为空!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    temp.Del = 1;
                    if (T_BaoxiaoItemsService.EditEntity(temp))
                    {
                        return(Json(new { ret = "ok", msg = "修改成功!" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { msg = "在修改中出错!" }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
        }
        //创建公告
        public ActionResult AddUpGonggao(GongGao gg)
        {
            if (gg.ID > 0)
            {
                GongGao ggs = GongGaoService.LoadEntities(x => x.ID == gg.ID).FirstOrDefault();
                ggs.text = gg.text;
                if (GongGaoService.EditEntity(ggs))
                {
                    return(Json("ok", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json("err", JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                gg.del     = false;
                gg.Addtime = MvcApplication.GetT_time();
                gg.Items   = 7;
                gg.bak     = "通知公告";


                GongGaoService.AddEntity(gg);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
        }
Example #10
0
        //新增信息表
        public ActionResult AddBzcmImage(BzcmText_FanChan btfc)
        {
            btfc.Addtime        = MvcApplication.GetT_time();
            btfc.DEL            = 0;
            btfc.AddUser        = LoginUser.ID;
            btfc.IsFristItemsID = Convert.ToInt32(Request["IsFristItemsID"]);
            string str = "ok";

            if (btfc.ID > 0)
            {
                BzcmText_FanChanService.EditEntity(btfc);
            }
            else
            {
                try { BzcmText_FanChanService.AddEntity(btfc); }
                catch (Exception e)
                {
                    if (btfc.Str_Image.Length > 0)
                    {
                        NewDeletFile(btfc.Str_Image);
                    }

                    str = e.ToString();
                }
            }


            return(Json(new { ret = str }, JsonRequestBehavior.AllowGet));
        }
Example #11
0
        public string SendTempletMessge(long uid, string TsText)
        {
            //var user = UserInfoService.LoadEntities(x => x.ID == uid).FirstOrDefault();
            var rtmp = WXXUserInfoService.LoadEntities(x => x.UID == uid).FirstOrDefault();

            if (rtmp == null)
            {
                return(null);
            }
            string strReturn = string.Empty;

            try
            {
                #region 获取access_token
                string     apiurl  = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxc67a3c17709458e5&secret=34a9647b2c1120e443cdf14b1a0d6b46";
                WebRequest request = WebRequest.Create(@apiurl);
                request.Method = "POST";
                WebResponse  response = request.GetResponse();
                Stream       stream   = response.GetResponseStream();
                Encoding     encode   = Encoding.UTF8;
                StreamReader reader   = new StreamReader(stream, encode);
                string       detail   = reader.ReadToEnd();
                var          jd       = JsonConvert.DeserializeObject <WXApi>(detail);
                string       token    = (String)jd.access_token;
                DateTime     dtime    = MvcApplication.GetT_time();
                var          wxx      = WXX_FormIDService.LoadEntities(x => x.AddUserID == uid && x.StopTime > dtime).DefaultIfEmpty();
                WXX_FormID   Minwxx   = new WXX_FormID();
                if (wxx.ToList()[0] != null)
                {
                    Minwxx = wxx.OrderBy(x => x.StopTime).FirstOrDefault();
                }
                else
                {
                    return(null);
                }
                #endregion
                #region 组装信息推送,并返回结果(其它模版消息于此类似)
                string url  = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=" + token;
                string temp = "{\"touser\": \"" + rtmp.WXID + "\"," +
                              "\"template_id\": \"3zN541eDUYsMVVZnqf6GEuZr7KDdOC1jamBsgEKHXY0\", " +
                              "\"topcolor\": \"#FF0000\", " +
                              "\"form_id\": \"" + Minwxx.FormID + "\"," +
                              "\"data\": " +
                              "{\"first\": {\"value\": \"您好,您有一条咨询通知信息\"}," +
                              "\"keyword1\": { \"value\": \"" + TsText + "\"}," +
                              "\"remark\": {\"value\": \"\" }}}";
                #endregion
                //核心代码
                GetResponseData(temp, @url);
                strReturn = "推送成功";
                //删除使用过的formid
                WXX_FormIDService.DeleteEntity(Minwxx);
            }
            catch (Exception ex)
            {
                strReturn = ex.Message;
            }
            return(strReturn);
        }
        public ActionResult Addzhgl(UserInfo Uinfo)
        {
            string rt = string.Empty;

            //检查用户是否重复
            if (SelectUserName(Uinfo))
            {
                rt = "IsCongfu";
                return(Content("IsCongfu"));
            }
            //检查创建用户是否到达上线
            var Ucount = UserInfoService.LoadEntities(x => x.MasterID == LoginUser.ID).DefaultIfEmpty();

            if (Ucount.Count() >= LoginUser.UserXiaoHao)
            {
                if (Ucount.Count() >= LoginUser.UserXiaoHao)
                {
                    rt = "UserUP";
                    return(Content("UserUP"));
                }
            }
            else
            {
                Uinfo.MasterID   = LoginUser.ID;
                Uinfo.ThisMastr  = false;
                Uinfo.UPwd       = Model.Enum.AddMD5.GaddMD5(Uinfo.UPwd);
                Uinfo.Click      = LoginUser.Click;
                Uinfo.OverTime   = LoginUser.OverTime;
                Uinfo.SubTime    = MvcApplication.GetT_time();
                Uinfo.ModifiedOn = Uinfo.SubTime;
                Uinfo.CityID     = LoginUser.CityID;

                UserInfoService.AddEntity(Uinfo);
                var Tuserinfo = UserInfoService.LoadEntities(x => x.UName == Uinfo.UName).FirstOrDefault();
                ////父级ID
                //UserInfo userInfo = UserInfoService.LoadEntities(u => u.ID == LoginUser.ID).FirstOrDefault();
                //var userRoleIdList = (from r in userInfo.RoleInfo
                //                      select r.ID).ToList();
                //获取区域归属 基础区域
                var           Tloginuser = UserInfoService.LoadEntities(x => x.ID == LoginUser.ID).FirstOrDefault();
                UserInfo_City ct         = Tloginuser.UserInfo_City.FirstOrDefault();
                ct.UserInfo_ID = Tuserinfo.ID;
                UserInfo_CityService.AddEntity(ct);
                //获取小号权限 小号权限是10
                List <int> list = new List <int>();
                list.Add(10);
                if (UserInfoService.setuserorderidnfo(Tuserinfo.ID, list))
                {
                    rt = "UserUP"; return(Content("ok"));
                }
                else
                {
                    rt = "UserUP"; return(Content("NO"));
                }
            }
            return(Content(rt));
        }
Example #13
0
        ///获取标记到期时间与条数
        ///
        public ActionResult GetBiaoJiDaoQiTime()
        {
            int Gint = (int)T_BoolItemService.LoadEntities(x => x.ID == 2).FirstOrDefault().@int;

            DateTime NowTime = MvcApplication.GetT_time();
            //int masterID =(Int32)( Convert.ToBoolean(LoginUser.ThisMastr) ? LoginUser.ID : LoginUser.MasterID);
            var tsave = T_SaveHtmlDataService.LoadEntities(x => x.UserID == LoginUser.ID && x.BiaoJiId == null && x.GongGong == 0).DefaultIfEmpty();

            return(Json(new { rows = tsave.ToList()[0] != null?tsave.Count():0, mess = "OK" }, JsonRequestBehavior.AllowGet));
        }
Example #14
0
        private string addBaoJiaTOP(T_BaoJiaToP tbop, ref long ThisAddId, bool Bl, ref string msg)
        {
            string ret;

            if (Bl)
            {
                var editid = Convert.ToInt64(Request["editID"]);
                tbop        = T_BaoJiaToPService.LoadEntities(x => x.id == editid).FirstOrDefault();
                tbop.GhTime = Convert.ToDateTime(Request["GhTime"]);
            }
            else
            {
                tbop.DelFlag = delFlag;
                tbop.AddTime = MvcApplication.GetT_time();
                string Ttime  = Request["GhTime"];
                var    tsplit = Ttime.Split('/');
                tbop.GhTime = new DateTime(int.Parse(tsplit[2]), int.Parse(tsplit[1]), int.Parse(tsplit[0]));
            }

            tbop.Kh_List_id = Request["khidselect"] != null?int.Parse(Request["khidselect"]) : 0;

            tbop.DaiBanYunShu   = Request["DaiBanYunShu"];
            tbop.HeTongQianDing = Request["HeTongQianDing"];
            tbop.JieShuanFanShi = Request["JieShuanFanShi"];
            tbop.JiShuYaoQiu    = Request["JiShuYaoQiu"];
            tbop.KHComname      = Request["KHComname"];
            tbop.HanShuiID      = int.Parse(Request["HanShuiID"]);
            tbop.PiaoJuID       = int.Parse(Request["PiaojiuID"]);
            string Addess = Request["Province"].ToString() + "," + Request["City"].ToString() + "," + Request["Village"].ToString();

            tbop.Addess = Addess;
            try
            {
                if (Bl)
                {
                    T_BaoJiaToPService.EditEntity(tbop);
                    ThisAddId = tbop.id;
                    msg       = "修改成功!";
                }
                else
                {
                    T_BaoJiaToPService.AddEntity(tbop);
                    var ThisAddId_list = YXB_Kh_listService.LoadEntities(x => x.id == tbop.Kh_List_id).FirstOrDefault();
                    ThisAddId = ThisAddId_list.T_BaoJiaToP.Max(x => x.id);
                    msg       = "添加成功,请继续添加产品信息!";
                }
                ret = "ok";
            }
            catch (Exception ex)
            {
                ret = ex.ToString();
            }

            return(ret);
        }
        //创建详细数据
        public ActionResult AddTableone()
        {
            T_CanPan tcp    = new T_CanPan();
            var      thisID = Request["ID"].ToString().Trim().Length <= 0 ? 0 : Convert.ToInt64(Request["ID"]);

            if (thisID == 0)
            {
                tcp.SczzDanjuID = Convert.ToInt64(Request["TextNameID"]);
                var tscdj = T_SczzDanjuService.LoadEntities(x => x.ID == tcp.SczzDanjuID).FirstOrDefault();
                if (tscdj == null)
                {
                    return(Json(new { result = "no", msg = "数据错误请联系管理员" }, JsonRequestBehavior.AllowGet));
                }
                else if (tscdj.ZhuangTai != 0)
                {
                    return(Json(new { result = "no", msg = "已审核的信息不可在次添加信息!" }, JsonRequestBehavior.AllowGet));
                }
                tcp.Cpname   = Request["Cpname"];
                tcp.ImageInt = Request["ImageInt"];
                if (Request["CpShuliang"].ToString().Trim().Length <= 0)
                {
                    return(Json(new { result = "no", msg = "数量不可为空" }, JsonRequestBehavior.AllowGet));
                }
                tcp.CpShuliang = Convert.ToDecimal(Request["CpShuliang"]);
                tcp.SczzItemID = Convert.ToInt64(Request["SczzItemID"]);
                tcp.Bak        = Request["Bak"];
                tcp.DEL        = 0;
                tcp.AddTime    = MvcApplication.GetT_time();
                tcp.AddUserID  = LoginUser.ID;
                if (Request["overtime"] == null && Request["overtime"].ToString().Trim().Length == 0)
                {
                    return(Json(new { result = "no", msg = "完工时间不可为空!" }, JsonRequestBehavior.AllowGet));
                }
                if (Request["overtime"] != null && Request["overtime"].ToString().Trim().Length > 0)
                {
                    tcp.OverTime   = Convert.ToDateTime(Request["overtime"]);
                    tcp.OverUserID = LoginUser.ID;
                }


                T_CanPanService.AddEntity(tcp);
                var temp = HuoquXLS((long)tcp.SczzDanjuID);
                return(Json(new { result = "ok", temp = temp }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                T_CanPanService.EditEntity(tcp);
                return(Json(new { result = false, ex = "" }, JsonRequestBehavior.AllowGet));
            }
        }
Example #16
0
 //添加求租信息
 public ActionResult AddQiuZhu(T_QiuZhuQiuGou tqz)
 {
     if (tqz.ID <= 0)
     {
         tqz.User_ID     = LoginUser.ID;
         tqz.AddUserTime = MvcApplication.GetT_time();
         T_QiuZhuQiuGouService.AddEntity(tqz);
         return(Json(new { ret = "ok", JsonRequestBehavior.AllowGet }));
     }
     else
     {
         return(Json(new { msg = "添加出错,请联系管理员!~", JsonRequestBehavior.AllowGet }));
     }
 }
Example #17
0
 //添加出租信息
 public ActionResult AddChuZhufrist(T_ChuZhuInfo Chuzhu)
 {
     if (Chuzhu.ID <= 0)
     {
         Chuzhu.UserID      = LoginUser.ID;
         Chuzhu.LaiYuan     = "NewAdd";
         Chuzhu.AdduserTime = MvcApplication.GetT_time();
         T_ChuZhuInfoService.AddEntity(Chuzhu);
         return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
     }
 }
Example #18
0
        //查找ID
        public ActionResult SechFromId()
        {
            DateTime dtime = MvcApplication.GetT_time();
            var      wxx   = WXX_FormIDService.LoadEntities(x => x.AddUserID == LoginUser.ID && x.StopTime > dtime).DefaultIfEmpty();

            if (wxx.ToList()[0] != null)
            {
                var Minwxx = wxx.OrderBy(x => x.StopTime).FirstOrDefault();
                return(Json(new { ret = "ok", Minwx = Minwxx }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { ret = "no", str = "查询信息空~" }, JsonRequestBehavior.AllowGet));
            }
        }
        //创建制造计划单
        public ActionResult AddTable()
        {
            T_SczzDanju tsd = new T_SczzDanju();

            tsd.TextNameID = Convert.ToInt64(Request["topnameid"]);
            tsd.AddTime    = MvcApplication.GetT_time();
            tsd.ZhuangTai  = 0;
            tsd.AddUser    = LoginUser.ID;
            tsd.del        = 0;
            T_SczzDanjuService.AddEntity(tsd);
            int totalCount = 0;
            var temp       = GetSCZZdanju(out totalCount);

            return(Json(new { result = true, temp = temp, total = totalCount }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult NewAddListYXY(T_YxPerson typ)
        {
            typ.AddTime   = MvcApplication.GetT_time();
            typ.ADDuserID = LoginUser.ID;
            typ.DEL       = 0;
            if (typ.ID <= 0)
            {
                T_YxPersonService.AddEntity(typ);
            }
            else
            {
                T_YxPersonService.EditEntity(typ);
            }

            return(Content("ok"));
        }
Example #21
0
        //创建ID
        public ActionResult AddFromId()
        {
            WXX_FormID wfm = new WXX_FormID();

            wfm.FormID    = Request["FromID"].ToString();
            wfm.AddTime   = MvcApplication.GetT_time();
            wfm.AddUserID = LoginUser.ID;
            wfm.CanUse    = 0;
            wfm.StopTime  = wfm.AddTime.AddDays(7);
            try
            {
                WXX_FormIDService.AddEntity(wfm);
                return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e) {
                return(Json(new { ret = "err", str = e.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }
Example #22
0
        //添加产品详细数据
        public ActionResult AddBaoJiaoOne()
        {
            YXB_Baojia bj = new YXB_Baojia();

            bj.AddTime      = MvcApplication.GetT_time();
            bj.DelFlag      = delFlag;
            bj.ZhuangTai    = 0;
            bj.CPname       = Convert.ToInt64(Request["CPname"]);
            bj.CPXingHao    = Convert.ToInt64(Request["CPXingHao"]);
            bj.CPShuLiang   = Convert.ToDecimal(Request["CPShuLiang"]);
            bj.BaoJiaTop_id = Convert.ToInt64(Request["editID"]);
            bj.WIN          = 0;
            bj.CPDengJiID   = Convert.ToInt64(Request["CPDengji"]);
            bj.Remark       = Request["Reamk"];
            YXB_BaojiaService.AddEntity(bj);
            Common.MemcacheHelper.Set("Allstr", Convert.ToInt64(Common.MemcacheHelper.Get("Allstr")) + 1);
            return(GetysbBaojia(bj.BaoJiaTop_id));
        }
        private string SeeClickPhoto(T_UserClick Uclick, long id, string Items)
        {
            if (Uclick == null)
            {
                //如果没有添加一条用户点击信息
                T_UserClick tucs = new T_UserClick();
                tucs.UserInfoId     = LoginUser.ID;
                tucs.ThisClick      = 1;
                tucs.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                T_UserClickService.AddEntity(tucs);
            }
            else
            {
                DateTime logintime = Convert.ToDateTime(Uclick.LoginClickTime);
                if (logintime.ToString("yyyy-MM-dd") == MvcApplication.GetT_time().ToString("yyyy-MM-dd"))
                {
                    Uclick.ThisClick = Uclick.ThisClick + 1;
                    T_UserClickService.EditEntity(Uclick);
                }
                else if (logintime < MvcApplication.GetT_time())
                {
                    Uclick.ThisClick      = 1;
                    Uclick.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                    T_UserClickService.EditEntity(Uclick);
                }
            }
            SeeQzCz scp = new SeeQzCz();

            scp.Del    = 0;
            scp.UserID = LoginUser.ID;
            if (Items == "QZ")
            {
                scp.QCItems  = 0;
                scp.QiuZhuID = id;
            }
            else
            {
                scp.ChuZhuID = 1;
                scp.ChuZhuID = id;
            }
            SeeQzCzService.AddEntity(scp);
            return("OK");
        }
Example #24
0
        //创建ID
        public ActionResult AddFromId()
        {
            string     wxid = Request["WXID"];
            long       uid  = WXXUserInfoService.LoadEntities(x => x.WXID == wxid).First().ID;
            WXX_FormID wfm  = new WXX_FormID();

            wfm.FormID    = Request["FromID"].ToString();
            wfm.AddTime   = MvcApplication.GetT_time();
            wfm.AddUserID = uid;
            wfm.CanUse    = 0;
            wfm.StopTime  = wfm.AddTime.AddDays(7);
            try
            {
                WXX_FormIDService.AddEntity(wfm);
                return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(new { ret = "err", str = e.ToString() }, JsonRequestBehavior.AllowGet));
            }
        }
Example #25
0
        //创建产品型号与名称
        public ActionResult ADDxinghaoName( )
        {
            string cpname = Request["Name"];
            var    Seltcp = T_ChanPinNameService.LoadEntities(x => x.MyTexts == cpname).FirstOrDefault();

            if (Seltcp == null)
            {
                T_ChanPinName Tcp = new T_ChanPinName();
                Tcp.MyColums     = Request["MyColums"];
                Tcp.MyTexts      = Request["Name"];
                Tcp.CreatePerson = LoginUser.ID;
                Tcp.CreateTime   = MvcApplication.GetT_time();
                Tcp.Del          = 0;
                T_ChanPinNameService.AddEntity(Tcp);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Isdistict", JsonRequestBehavior.AllowGet));
            }
        }
        //添加型号 与产品头部信息
        public ActionResult ADDitems()
        {
            var obj = Request["obj"].ToString().Trim();
            var VL  = int.Parse(Request["VL"]);

            if (VL == 1)
            {
                var tmp = T_SczzItemService.LoadEntities(x => x.Text == obj).FirstOrDefault();
                if (tmp != null)
                {
                    return(Json("Isdistict", JsonRequestBehavior.AllowGet));
                }
                T_SczzItem TS = new T_SczzItem();
                TS.AddTime = MvcApplication.GetT_time();
                TS.AddUser = LoginUser.ID;
                TS.Text    = obj;
                TS.Del     = 0;
                T_SczzItemService.AddEntity(TS);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            else if (VL == 0)
            {
                var tmp = T_ShengChanZhiZhaoTopNameService.LoadEntities(x => x.TopText == obj).FirstOrDefault();
                if (tmp != null)
                {
                    return(Json("Isdistict", JsonRequestBehavior.AllowGet));
                }
                T_ShengChanZhiZhaoTopName tt = new T_ShengChanZhiZhaoTopName();
                tt.addtime = MvcApplication.GetT_time();
                tt.adduser = LoginUser.ID;
                tt.Del     = 0;
                tt.TopText = obj;
                T_ShengChanZhiZhaoTopNameService.AddEntity(tt);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("errer", JsonRequestBehavior.AllowGet));
            }
        }
 //添加网站更新地址
 public ActionResult AddHrefCity(T_UpHerfCity tpe)
 {
     if (tpe.ID <= 0)
     {
         if (T_UpHerfCityService.LoadEntities(x => x.Items == tpe.Items && x.City_ID == tpe.City_ID).FirstOrDefault() == null)
         {
             tpe.Del     = 0;
             tpe.AddTime = MvcApplication.GetT_time();
             tpe.AddUser = LoginUser.ID;
             T_UpHerfCityService.AddEntity(tpe);
             return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { msg = "不可添加重复的更新地址!~", JsonRequestBehavior.AllowGet }));
         }
     }
     else
     {
         return(Json(new { msg = "添加出错,请联系管理员!~", JsonRequestBehavior.AllowGet }));
     }
 }
Example #28
0
        //追加发货信息
        public ActionResult AddFahuo(T_WinBakFaHuo wbf)
        {
            var mmp = YXB_BaojiaService.LoadEntities(x => x.id == wbf.BaoJia_ID).FirstOrDefault();

            if (mmp == null)
            {
                return(Json(new { ret = "no", msg = "报价单中没有要修改的报价数据!请联系管理员!" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                int fhint = T_WinBakFaHuoService.LoadEntities(x => x.BaoJia_ID == wbf.BaoJia_ID) == null?0:Convert.ToInt32(T_WinBakFaHuoService.LoadEntities(x => x.BaoJia_ID == wbf.BaoJia_ID).Sum(x => x.FahuoInt));
                if (fhint + wbf.FahuoInt > mmp.CPShuLiang)
                {
                    return(Json(new { ret = "no", msg = "发货总数不可大于发货量!" }, JsonRequestBehavior.AllowGet));
                }
            }
            wbf.AddTime = MvcApplication.GetT_time();
            wbf.AddUser = LoginUser.ID;
            wbf.Del     = 0;
            T_WinBakFaHuoService.AddEntity(wbf);

            return(Json(new { ret = "ok" }, JsonRequestBehavior.AllowGet));
        }
Example #29
0
        //添加写入信息//修改我写入的信息
        public ActionResult AddEditData(T_FGJHtmlData tfhd)
        {
            if (tfhd.ID > 0)//修改
            {
                if (T_FGJHtmlDataService.EditEntity(tfhd))
                {
                    return(Json(new { ret = "ok", msg = "修改成功" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { ret = "no", msg = "在修改过程中出现未知错误,请联系管理员!" }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                tfhd.AddItemsUserID = LoginUser.ID;
                tfhd.Laiyuan        = "AddDAT";
                tfhd.Pingmi_int     = decimal.Parse(Request["FwMianji"]);
                tfhd.Money_int      = decimal.Parse(Request["Smoney"]);
                tfhd.FwSumMoney     = Request["Amoney"] + "万(单价" + tfhd.Money_int + "元/㎡)";
                tfhd.FwHuXing       = Request["HXs"] + "室" + Request["HXt"] + "厅" + Request["HXw"] + "卫";
                tfhd.SumMoneyID     = AllClass.GetMoney(Request["Smoney"].ToString());
                tfhd.MianjiID       = AllClass.GeiMinji(tfhd.FwMianji);
                tfhd.HuXingID       = AllClass.GetHuxing(tfhd.FwHuXing);
                tfhd.AddUserTiem    = MvcApplication.GetT_time();
                tfhd.HLhref         = "";
                tfhd.Image_str      = tfhd.Image_str != null?tfhd.Image_str.Trim().Length > 0 ? "有---" + tfhd.Image_str : tfhd.Image_str : tfhd.Image_str;

                var DisctD = T_FGJHtmlDataService.LoadEntities(x => x.photo == tfhd.photo && x.HLName == tfhd.HLName).FirstOrDefault();
                if (DisctD != null)
                {
                    return(Json(new { ret = "no", msg = "要新增的信息中电话与信息名称在数据库中的有重复,请核对信息在添加!" }, JsonRequestBehavior.AllowGet));
                }
                T_FGJHtmlDataService.AddEntity(tfhd);
                return(Json(new { ret = "ok", msg = "添加成功!" }, JsonRequestBehavior.AllowGet));
            }
        }
Example #30
0
        public ActionResult saveitem()
        {
            if (Request["strId"] == null)
            {
                return(Content("errer"));
            }
            var id       = Convert.ToInt64(Request["strId"]);
            var savehtml = T_SaveHtmlDataService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (savehtml != null)
            {
                savehtml.UserID   = LoginUser.ID;
                savehtml.SaveTime = MvcApplication.GetT_time();
                savehtml.BiaoJiId = null;
                savehtml.GongGong = 0;
                savehtml.MasterID = LoginUser.MasterID;
                T_SaveHtmlDataService.EditEntity(savehtml);
                return(Content("ok"));
            }
            else
            {
                return(Content("数据库中不存在要查询的ID号!"));
            }
        }