Beispiel #1
0
        /// <summary>
        /// 清除乘务员的指纹信息
        /// <summary>
        public InterfaceOutPut ClearFingerPrint(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                CommonJsonModel cjm             = new CommonJsonModel(Data);
                string          strTrainmanGUID = ObjectConvertClass.static_ext_string(cjm.GetValue("strTrainmanGUID"));
                string          strSql          = @"update TAB_Org_Trainman set Fingerprint1=null,Fingerprint2=null 
     Where strTrainmanGUID =@strTrainmanGUID";
                SqlParameter[]  sqlParameters   = new SqlParameter[] { new SqlParameter("strTrainmanGUID", strTrainmanGUID), };
                int             count           = SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, sqlParameters);
                if (count > 0)
                {
                    output.result    = 0;
                    output.resultStr = "指纹信息清除成功";
                }
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("Interface.ClearFingerPrint:" + ex.Message);
                throw ex;
            }
            return(output);
        }
 /// <summary>
 /// 模型是对象,key对应是集合,返回集合
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public CommonJsonModel GetCollection(string key)
 {
     if (!isModel)
     {
         return(null);
     }
     if (string.IsNullOrEmpty(key))
     {
         return(null);
     }
     foreach (string subjson in base._GetCollection(this.rawjson))
     {
         CommonJsonModel model = new CommonJsonModel(subjson);
         if (!model.IsValue())
         {
             continue;
         }
         if (model.Key == key)
         {
             CommonJsonModel submodel = new CommonJsonModel(model.Value);
             if (!submodel.IsCollection())
             {
                 return(null);
             }
             else
             {
                 return(submodel);
             }
         }
     }
     return(null);
 }
        public static string Getaccesstoken(string appid, string appsecret)
        {
            string urljson = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + appsecret;
            string strjson = "";

            ServicePointManager.ServerCertificateValidationCallback =
                new RemoteCertificateValidationCallback(RemoteCertificateValidate);
            UTF8Encoding   encoding  = new UTF8Encoding();
            HttpWebRequest myRequest =
                (HttpWebRequest)WebRequest.Create(urljson);

            //string path = HttpContext.Current.Request.PhysicalApplicationPath;
            //X509Certificate2 cert = new X509Certificate2(path + WxPayConfig.SSLCERT_PATH, WxPayConfig.SSLCERT_PASSWORD);
            //myRequest.ClientCertificates.Add(cert);
            myRequest.Method      = "GET";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            HttpWebResponse response;
            Stream          responseStream;
            StreamReader    reader;
            string          srcString;

            response       = myRequest.GetResponse() as HttpWebResponse;
            responseStream = response.GetResponseStream();
            reader         = new System.IO.StreamReader(responseStream, Encoding.UTF8);
            srcString      = reader.ReadToEnd();
            reader.Close();
            if (srcString.Contains("access_token"))
            {
                CommonJsonModel model = new CommonJsonModel(srcString);
                strjson = model.GetValue("access_token");
            }
            return(strjson);
        }
        public static string Getjsapi_ticket(string accesstoken)
        {
            //string accesstoken = (string)HttpContext.Current.Request.Cookies["access_token"].Value;
            //string accesstoken = Getaccesstoken();
            string urljson = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accesstoken + "&type=jsapi";
            string strjson = "";

            //添加证书
            ServicePointManager.ServerCertificateValidationCallback =
                new RemoteCertificateValidationCallback(RemoteCertificateValidate);
            UTF8Encoding   encoding  = new UTF8Encoding();
            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(urljson);

            //string path = HttpContext.Current.Request.PhysicalApplicationPath;
            //X509Certificate2 cert = new X509Certificate2(path + WxPayConfig.SSLCERT_PATH, WxPayConfig.SSLCERT_PASSWORD);
            //myRequest.ClientCertificates.Add(cert);

            myRequest.Method      = "GET";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            HttpWebResponse response       = myRequest.GetResponse() as HttpWebResponse;
            Stream          responseStream = response.GetResponseStream();
            StreamReader    reader         = new System.IO.StreamReader(responseStream, Encoding.UTF8);
            string          srcString      = reader.ReadToEnd();

            reader.Close();
            if (srcString.Contains("ticket"))
            {
                CommonJsonModel model = new CommonJsonModel(srcString);
                strjson = model.GetValue("ticket");
                //HttpContext.Current.Session["ticketzj"] = strjson;
            }

            return(strjson);
        }
Beispiel #5
0
        /// <summary>
        /// 获得对象信息
        /// <summary>
        public InterfaceOutPut GetEntry(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 0;
            try
            {
                CommonJsonModel            cjm = new CommonJsonModel(Data);
                Base_TrainNoQueryCondition _Base_TrainNoQueryCondition = new Base_TrainNoQueryCondition();
                _Base_TrainNoQueryCondition.strGUID = ObjectConvertClass.static_ext_string(cjm.GetValue("strGUID"));
                DBBase_TrainNo dbBase_TrainNo = new DBBase_TrainNo(ThinkFreely.DBUtility.SqlHelper.ConnString);
                Base_TrainNo   _Base_TrainNo  = dbBase_TrainNo.GetModel(_Base_TrainNoQueryCondition);
                if (_Base_TrainNo == null)
                {
                    output.resultStr = "没有对应数据";
                }
                else
                {
                    output.result = 1;
                    List <Base_TrainNo> Base_TrainNoList = new List <Base_TrainNo>();
                    Base_TrainNoList.Add(_Base_TrainNo);
                    output.data = Base_TrainNoList;
                }
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("InterfaceBase_TrainNo.GetEntry:" + ex.Message);
            }
            return(output);
        }
Beispiel #6
0
        public string GetSlidePicture(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            sbStr.Append("[{\"msg\":\"获取失败,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
            CommonJsonModel        model = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
            List <CommonJsonModel> lst   = model.GetCollection();

            foreach (CommonJsonModel item in lst)
            {
                string    tempPage     = item.GetValue("_Page");
                string    tempPageSize = item.GetValue("_PageSize");
                int       _Page        = (tempPage != "" && Convert.ToInt32(tempPage) > 0)? Convert.ToInt32(item.GetValue("_Page")) : 1;
                int       _PageSize    = (tempPageSize != "" && Convert.ToInt32(tempPageSize) > 0) ? Convert.ToInt32(item.GetValue("_PageSize")) : 100;
                DataTable dt           = new DataTable();
                DataSet   ds           = new ZhouFu.Bll.DataHandler().GetList("dbo.TB_SlidePicture", "ID,FilePath,Url", "sort", _PageSize, _Page, false, false, "");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    dt = ds.Tables[0];
                    sbStr.Clear();
                    sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                }
            }
            return(sbStr.ToString());
        }
Beispiel #7
0
        public string GetApplyForProList(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            sbStr.Append("[{\"msg\":\"获取失败,内部处理错误。\",\"data\":\"\",\"state\":\"2\"}]");
            try {
                StringBuilder          SqlWhere = new StringBuilder();
                string                 Fields   = "id,title,pro_money,hk_type,hk_month,hope_rate,status";
                CommonJsonModel        model    = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel> lst      = model.GetCollection();
                Model.TB_Project       proModel = new Model.TB_Project();
                foreach (CommonJsonModel item in lst)
                {
                    int    Page     = Convert.ToInt32(item.GetValue("_Page"));
                    int    PageSize = Convert.ToInt32(item.GetValue("_PageSize"));
                    string LoginId  = item.GetValue("_LoginId");
                    SqlWhere.AppendFormat("status<=4 and  pub_user={0}", LoginId);
                    DataTable dt = new DataTable();
                    DataSet   ds = new ZhouFu.Bll.DataHandler().GetList("TB_Project", Fields, "id", PageSize, Page, false, true, SqlWhere.ToString());
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        sbStr.Append("[{\"msg\":\"获取数据成功。\",\"data\":" + EasyUIJsonHelper.TableToJson(ds.Tables[0]) + ",\"state\":\"0\"}]");
                    }
                    else
                    {
                        sbStr.Append("[{\"msg\":\"获取数据成功,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
                    }
                }
            }
            catch { }
            return(sbStr.ToString());
        }
Beispiel #8
0
        public InterfaceOutPut Del(string data)
        {
            ClearOutput();
            CommonJsonModel model = new CommonJsonModel(data);
            string          ID    = model.GetValue("ID");
            string          log   = model.GetValue("log");

            if (string.IsNullOrEmpty(ID))
            {
                output.result    = 1;
                output.resultStr = "传入ID为空,无法删除记录!";
                return(output);
            }

            try
            {
                new DBAnnualLeave().Del(ID, log);
            }
            catch (Exception ex)
            {
                output.result    = 1;
                output.resultStr = ex.Message.ToString();
            }

            return(output);
        }
Beispiel #9
0
        public string AddCompanyFiles(string _StrJson)
        {
            StringBuilder          sbResult  = new StringBuilder();
            string                 filepath  = string.Empty;
            int                    iRowCount = 0;
            string                 strTemp   = string.Empty;
            CommonJsonModel        model     = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
            List <CommonJsonModel> lst       = model.GetCollection();

            foreach (CommonJsonModel item in lst)
            {
                #region 图片上传
                byte[] imgStream = Convert.FromBase64String(item.GetValue("_Stream"));
                if (!imgStream.Equals(""))
                {
                    string imgname = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
                    filepath = "/Upload/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.Date.Day.ToString().PadLeft(2, '0') + "/";
                    string webpath = System.Web.HttpContext.Current.Server.MapPath("/" + filepath);
                    if (!Directory.Exists(webpath))    //不存在此目录则创建目录
                    {
                        Directory.CreateDirectory(webpath);
                    }

                    FileStream   fStream = new FileStream((webpath + imgname), FileMode.Create, FileAccess.Write);
                    BinaryWriter bw      = new BinaryWriter(fStream);
                    bw.Write(imgStream);
                    bw.Close();
                    fStream.Close();
                    filepath = filepath + imgname;
                }
                #endregion
                Model.Sm_CaseInformation modelCase = new Model.Sm_CaseInformation();
                modelCase.Add_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                modelCase.Describe = item.GetValue("_Describe");
                modelCase.MonadID  = Convert.ToInt32(item.GetValue("_LoginId"));
                modelCase.FilePath = filepath;
                iRowCount          = new Bll.Sm_CaseInformation().Add(modelCase);
                if (iRowCount > 0)
                {
                    DataSet dsFile = new Bll.DataHandler().GetList("Sm_CaseInformation", "ID,Name,FilePath,bigFilePath", "ID", 100, 1, false, false, "MonadID=" + item.GetValue("_LoginId"));
                    if (dsFile != null && dsFile.Tables[0].Rows.Count > 0)
                    {
                        DataTable dtFile = dsFile.Tables[0];
                        strTemp = EasyUIJsonHelper.TableToJson(dtFile);
                    }
                    sbResult.Append("[{\"msg\":\"添加成功\",\"data\":" + strTemp + ",\"state\":\"0\"}]");
                }
                else
                {
                    sbResult.Append("[{\"msg\":\"添加失败,服务器处理出错\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            return(sbResult.ToString());
        }
        public IActionResult AddTown(CommonJsonModel model)
        {
            bool isAdded = false;

            if (!string.IsNullOrEmpty(model.Name))
            {
                model.Name = model.Name.Trim();
                isAdded    = _commonService.AddTown(model);
            }
            string error = isAdded ? Messages.INFO_ENTITY_ADDED : Messages.ERROR_ENTITY_EXISTS;

            return(Json(new ResponseJsonModel(isAdded, error: error)));
        }
Beispiel #11
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            var json = HttpContext.Current.Request["json"];

            string action  = PublicMethod.GetString(getObj("action"));
            string jsonStr = string.Empty;
            string keyId   = string.Empty;

            if (string.IsNullOrEmpty(action) && !string.IsNullOrEmpty(json))
            {
                CommonJsonModel model = DeSerialize(json);
                action  = model.GetValue("action");
                keyId   = model.GetValue("id");
                jsonStr = model.GetModel("jsonEntity").Rawjson;
                // model = DeSerialize(json1);
            }

            switch (action)
            {
            case "GetProductMainEntity":
                this.GetProductMainEntity(context);
                break;

            case "add":
                this.AddProductInfo(context, jsonStr);
                break;

            case "edit":
                this.EditProductInfo(context, jsonStr, keyId);
                break;

            case "delete":
                this.DelProductInfo(context);
                break;

            case "mx":
                context.Response.Write(GetMxJson());
                break;

            case "GetMultiPage":     //多表联合查询分页
                var jsonData1 = GetProductMultiPage(context);
                context.Response.Write(jsonData1);
                break;

            default:
                var jsonData = GetProductInMainJson(context);
                context.Response.Write(jsonData);
                break;
            }
        }
        public bool AddVehicleType(CommonJsonModel model)
        {
            var vehicleType = DbContext.VehicleTypes
                              .SingleOrDefault(c => c.Name.ToLower() == model.Name.ToLower());

            if (vehicleType == null)
            {
                vehicleType = Map(model, new VehicleType());
                DbContext.VehicleTypes.Add(vehicleType);
                DbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
        public bool AddColor(CommonJsonModel model)
        {
            var color = DbContext.Colors
                        .SingleOrDefault(c => c.Name.ToLower() == model.Name.ToLower());

            if (color == null)
            {
                color = Map(model, new Color());
                DbContext.Colors.Add(color);
                DbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
        public bool AddGearboxType(CommonJsonModel model)
        {
            var gearboxType = DbContext.GearboxTypes
                              .SingleOrDefault(c => c.Name.ToLower() == model.Name.ToLower());

            if (gearboxType == null)
            {
                gearboxType = Map(model, new GearboxType());
                DbContext.GearboxTypes.Add(gearboxType);
                DbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
        public bool AddTown(CommonJsonModel model)
        {
            var town = DbContext.Towns
                       .SingleOrDefault(c => c.Name.ToLower() == model.Name.ToLower());

            if (town == null)
            {
                town = Map(model, new Town());
                DbContext.Towns.Add(town);
                DbContext.SaveChanges();
                return(true);
            }
            return(false);
        }
Beispiel #16
0
        public string UpdateHeadPortrait(string _StrJson)
        {
            StringBuilder sbResult = new StringBuilder();

            try
            {
                string                 strSql    = "update sys_manager set user_picture='{0}' where ID={1}";
                string                 filepath  = string.Empty;
                int                    iRowCount = 0;
                CommonJsonModel        model     = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel> lst       = model.GetCollection();
                string                 imgname   = string.Empty;
                foreach (CommonJsonModel item in lst)
                {
                    #region 图片上传

                    byte[] imgStream = Convert.FromBase64String(item.GetValue("_Stream"));
                    if (!imgStream.Equals(""))
                    {
                        imgname  = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
                        filepath = "/Upload/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.Date.Day + "/";
                        string webpath = System.Web.HttpContext.Current.Server.MapPath("/" + filepath);
                        if (!Directory.Exists(webpath))//不存在此目录则创建目录
                        {
                            Directory.CreateDirectory(webpath);
                        }
                        FileStream   fStream = new FileStream((webpath + imgname), FileMode.Create, FileAccess.Write);
                        BinaryWriter bw      = new BinaryWriter(fStream);
                        bw.Write(imgStream);
                        bw.Close();
                        fStream.Close();
                    }
                    #endregion
                    iRowCount = DbHelperSQL.ExecuteSql(string.Format(strSql, (filepath + imgname), item.GetValue("_LoginId")));
                }
                if (iRowCount > 0)
                {
                    sbResult.Append("[{\"msg\":\"修改成功\",\"data\":\"" + filepath + imgname + "\",\"state\":\"0\"}]");
                }
                else
                {
                    sbResult.Append("[{\"msg\":\"修改失败,执行修改出错。\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            catch
            {
                sbResult.Append("[{\"msg\":\"修改失败,服务器处理出错\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbResult.ToString());
        }
Beispiel #17
0
        //网络问政
        private int InfoWlwz(string strjson)
        {
            int                    iRowCount = 0;
            CommonJsonModel        model     = new CommonJsonModel(Regex.Replace(strjson, @"\r\n", ""));
            List <CommonJsonModel> lst       = model.GetCollection();

            foreach (CommonJsonModel item in lst)
            {
                int    action   = 1;
                string number   = GetNumber(1);
                string title    = item.GetValue("title"); //标题
                string filepath = string.Empty;           //图片地址
                #region 图片上传
                byte[] imgStream = Convert.FromBase64String(item.GetValue("stream"));
                if (!imgStream.Equals(""))
                {
                    string imgname = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
                    filepath = "Upload/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.Date.Day + "/";
                    string webpath = System.Web.HttpContext.Current.Server.MapPath("/" + filepath);
                    if (!Directory.Exists(webpath))//不存在此目录则创建目录
                    {
                        Directory.CreateDirectory(webpath);
                    }
                    FileStream   fStream = new FileStream(webpath, FileMode.Create, FileAccess.Write);
                    BinaryWriter bw      = new BinaryWriter(fStream);
                    bw.Write(imgStream);
                    bw.Close();
                    fStream.Close();
                }
                #endregion
                string content   = item.GetValue("content");   //内容
                string type      = item.GetValue("type");      //类型(投诉...)
                string toppic    = item.GetValue("toppic");    //话题
                string deprtment = item.GetValue("deprtment"); //提问部门
                string pubuser   = item.GetValue("pubuser");   //提问用户
                string longitude = item.GetValue("longitude"); //经度
                string latitude  = item.GetValue("latitude");  //纬度
                string strsql    = string.Format("insert into sys_Question(Number,Title,QuestionContent,QuestionType,PulishUserID,Longitude,Latitude,TopictypeID,ImageUrl,DepartmentID,Flag)values('{0}','{1}','{2}',{3},{4},{5},{6},{7},'{8}',{9},{10});", number, title, content, type, pubuser, longitude, latitude, toppic, filepath, deprtment, action);
                try
                {
                    iRowCount = DbHelperSQL.ExecuteSql(strsql);
                }
                catch {
                    iRowCount = 0;
                }
            }
            return(iRowCount);
        }
            /// <summary>
            /// 当模型是对象,返回拥有的key
            /// </summary>
            /// <returns></returns>
            public List <string> GetKeys()
            {
                if (!isModel)
                {
                    return(null);
                }
                List <string> list = new List <string>();

                foreach (string subjson in base._GetCollection(this.rawjson))
                {
                    string key = new CommonJsonModel(subjson).Key;
                    if (!string.IsNullOrEmpty(key))
                    {
                        list.Add(key);
                    }
                }
                return(list);
            }
Beispiel #19
0
        public LCOutput Clear(string data)
        {
            outPut.Clear();
            try
            {
                CommonJsonModel jsonModel    = new CommonJsonModel(data);
                string          WorkShopGUID = jsonModel.GetValue("WorkShopGUID");
                string          CheDuiGUID   = jsonModel.GetValue("CheDuiGUID");

                new DBKeyMan().Clear(WorkShopGUID, CheDuiGUID);
            }
            catch (Exception ex)
            {
                outPut.result    = 1;
                outPut.resultStr = ex.Message.ToString();
            }

            return(outPut);
        }
Beispiel #20
0
        /// <summary>
        /// 保存信息
        /// <summary>
        public InterfaceOutPut Save(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 0;
            try
            {
                CommonJsonModel      cjm = new CommonJsonModel(Data);
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
                Base_TrainNo         _Base_TrainNo        = javaScriptSerializer.Deserialize <Base_TrainNo>(Data);
                DBBase_TrainNo       dbBase_TrainNo       = new DBBase_TrainNo(ThinkFreely.DBUtility.SqlHelper.ConnString);
                dbBase_TrainNo.Add(_Base_TrainNo);
                output.result = 1;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("InterfaceBase_TrainNo.Save:" + ex.Message);
            }
            return(output);
        }
Beispiel #21
0
        /// <summary>
        /// 获得数据列表
        /// <summary>
        public InterfaceOutPut GetList(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 0;
            try
            {
                CommonJsonModel cjm = new CommonJsonModel(Data);

                Base_TrainNoQueryCondition _Base_TrainNoQueryCondition = new Base_TrainNoQueryCondition();


                DBBase_TrainNo dbBase_TrainNo = new DBBase_TrainNo(ThinkFreely.DBUtility.SqlHelper.ConnString);
                DataTable      dt             = dbBase_TrainNo.GetDataTable(_Base_TrainNoQueryCondition);
                output.data   = dt;
                output.result = 1;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("InterfaceBase_TrainNo.GetList:" + ex.Message);
            }
            return(output);
        }
Beispiel #22
0
        public string UpdateCompanyInformation(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            try
            {
                StringBuilder          sbsql      = new StringBuilder();
                CommonJsonModel        model      = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel> lst        = model.GetCollection();
                ZhouFu.Bll.Sm_Monad    bllMonad   = new Bll.Sm_Monad();
                ZhouFu.Model.Sm_Monad  modelMonad = new Model.Sm_Monad();
                foreach (CommonJsonModel item in lst)
                {
                    #region 模型参数设置
                    string _CompanyId         = item.GetValue("_CompanyId");         //主键ID
                    string _MonadName         = item.GetValue("_MonadName");         //企业名称
                    string _MailBox           = item.GetValue("_MailBox");           //企业邮箱
                    string _Type              = item.GetValue("_Type");              //企业类型
                    string _Nature            = item.GetValue("_Nature");            //企业性质
                    string _NumberOfPeople    = item.GetValue("_NumberOfPeople");    //企业人数
                    string _RegisteredCapital = item.GetValue("_RegisteredCapital"); //注册资金
                    string _Url      = item.GetValue("_Url");                        //网址
                    string _Province = item.GetValue("_Province");                   //省份
                    string _City     = item.GetValue("_City");                       //城市
                    string _County   = item.GetValue("_County");                     //区县
                    string _RunRange = item.GetValue("_RunRange");                   //经营范围
                    string _Describe = item.GetValue("_Describe");                   //简介
                    //string _LogoUrl = item.GetValue("_LogoUrl");//企业Logo

                    if (_CompanyId != "")
                    {
                        modelMonad = bllMonad.GetModel(Convert.ToInt32(_CompanyId));
                    }
                    if (_MonadName != "")
                    {
                        modelMonad.MonadName = _MonadName;
                    }
                    if (_MailBox != "")
                    {
                        modelMonad.MailBox = _MailBox;
                    }
                    if (_Type != "")
                    {
                        modelMonad.Type = Convert.ToInt32(_Type);
                    }
                    if (_Nature != "")
                    {
                        modelMonad.Nature = (_Nature == ""?0:Convert.ToInt32(_Nature));
                    }
                    if (_NumberOfPeople != "")
                    {
                        modelMonad.NumberOfPeople = Convert.ToInt32(_NumberOfPeople);
                    }
                    if (_RegisteredCapital != "")
                    {
                        modelMonad.RegisteredCapital = Convert.ToInt32(_RegisteredCapital);
                    }
                    if (_Url != "")
                    {
                        modelMonad.Url = _Url;
                    }
                    if (_Province != "")
                    {
                        modelMonad.Province = _Province;
                    }
                    if (_City != "")
                    {
                        modelMonad.City = _City;
                    }
                    if (_County != "")
                    {
                        modelMonad.County = _County;
                    }
                    if (_RunRange != "")
                    {
                        modelMonad.RunRange = _RunRange;
                    }
                    if (_Describe != "")
                    {
                        modelMonad.Describe = _Describe;
                    }
                    //if (_LogoUrl != ""){modelMonad.LogoUrl = _LogoUrl;}
                    #endregion
                }
                if (bllMonad.Update(modelMonad))
                {
                    sbStr.Append("[{\"msg\":\"修改成功\",\"data\":\"\",\"state\":\"0\"}]");
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            catch
            {
                sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbStr.ToString());
        }
Beispiel #23
0
        public string UpdatePersonInformation(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            try
            {
                StringBuilder            sbsql        = new StringBuilder();
                CommonJsonModel          model        = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel>   lst          = model.GetCollection();
                ZhouFu.Bll.sys_Manager   bllManager   = new Bll.sys_Manager();
                ZhouFu.Model.sys_Manager modelManager = new Model.sys_Manager();
                foreach (CommonJsonModel item in lst)
                {
                    #region 模型参数设置
                    string _UserId       = item.GetValue("_UserId");       //用户编号
                    string aaaa          = item.Rawjson;
                    string _RealName     = item.GetValue("_RealName");     //真实姓名
                    string _Sex          = item.GetValue("_Sex");          //性别
                    string _Province     = item.GetValue("_Province");     //省
                    string _City         = item.GetValue("_City");         //城市
                    string _County       = item.GetValue("_County");       //区县
                    string _Email        = item.GetValue("_Email");        //邮箱
                    string _Mobile       = item.GetValue("_Mobile");       //手机
                    string _CodeNumber   = item.GetValue("_CodeNumber");   //身份证号
                    string _BankId       = item.GetValue("_BankId");       //银行ID号
                    string _BankCard     = item.GetValue("_BankCard");     //银行卡号
                    string _BankProvince = item.GetValue("_BankProvince"); //开户省份
                    string _BankCity     = item.GetValue("_BankCity");     //开户城市
                    string _BankAddress  = item.GetValue("_BankAddress");  //开户地址
                    if (_UserId != "")
                    {
                        modelManager = bllManager.GetModel(Convert.ToInt32(_UserId));
                    }
                    if (_RealName != "")
                    {
                        modelManager.RealName = _RealName;
                    }
                    if (_Sex != "")
                    {
                        modelManager.user_sex = _Sex;
                    }
                    if (_Province != "")
                    {
                        modelManager.user_province = _Province;
                    }
                    if (_City != "")
                    {
                        modelManager.user_city = _City;
                    }
                    if (_County != "")
                    {
                        modelManager.user_county = _County;
                    }
                    if (_Email != "")
                    {
                        modelManager.user_email = _Email;
                    }
                    if (_Mobile != "")
                    {
                        modelManager.user_mobile = _Mobile;
                    }
                    if (_CodeNumber != "")
                    {
                        modelManager.CodeNumber = _CodeNumber;
                    }
                    if (_BankId != "")
                    {
                        modelManager.bank_id = Convert.ToInt32(_BankId);
                    }
                    if (_BankCard != "")
                    {
                        modelManager.bank_card = _BankCard;
                    }
                    if (_BankProvince != "")
                    {
                        modelManager.bank_province = _BankProvince;
                    }
                    if (_BankCity != "")
                    {
                        modelManager.bank_city = _BankCity;
                    }
                    if (_BankAddress != "")
                    {
                        modelManager.bank_address = _BankAddress;
                    }
                    #endregion
                }
                if (bllManager.Update(modelManager))
                {
                    sbStr.Append("[{\"msg\":\"修改成功\",\"data\":\"\",\"state\":\"0\"}]");
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            catch
            {
                sbStr.Append("[{\"msg\":\"修改失败,服务器处理错误\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbStr.ToString());
        }