Exemplo n.º 1
0
        public static string AddBusinessman(int curUserId, string bs_LoginName, int bs_TypeId, string bs_Name, string bs_Contact, string loginUserInfo)
        {
            string returnStr = "";
            string logInfo = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    string sysUserReturnStr = UserManager.SaveUser(curUserId, bs_LoginName, bs_Name, KeyManager.UserTypeId_BuissiensUser, loginUserInfo);

                    if (sysUserReturnStr.Equals(KeyManager.RetrunSucceed))
                    {
                        tbl_sys_businessman buss = new tbl_sys_businessman();
                        //buss.Businessman_LoginName = bs_LoginName;
                        //buss.Businessman_TypeID = bs_TypeId;
                        //buss.Businessman_Name = bs_Name;
                        //buss.Businessman_Password = KeyManager.Default_Pwd;
                        //buss.Businessman_ContactPhone = bs_Contact;
                        db.AddTotbl_sys_businessman(buss);
                        logInfo = "Businessman_LoginName=" + bs_LoginName + ",Businessman_TypeID=" + bs_TypeId + ",Businessman_Name=" + bs_Name + ",Businessman_Password = "******",Businessman_ContactPhone = " + bs_Contact;
                        if (db.SaveChanges() != 0)
                        {
                            returnStr = "成功!";
                        }
                        else
                            returnStr = "不成功!";
                    }
                    else
                    {
                        returnStr = sysUserReturnStr;
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SystemUsersManager, "新增用户," + logInfo + ",错误信息:" + e.Message, loginUserInfo);
            }
            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SystemUsersManager, "新增用户," + logInfo, loginUserInfo);
            return returnStr;
        }
Exemplo n.º 2
0
        public static string SaveVenues(int curUserId, string venueInfo, string loginUserInfo)
        {
            string returnStr = "";
            JObject objVenue = JObject.Parse(venueInfo);
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    string saveUserReturn = UserManager.SaveUser(curUserId, objVenue["loginName"].ToString(), objVenue["venueName"].ToString(), int.Parse(objVenue["venueTypeID"].ToString()), loginUserInfo);

                    if (saveUserReturn.Equals(KeyManager.RetrunSucceed))
                    {
                        tbl_sys_businessman bus = new tbl_sys_businessman();
                        bus.Business_Name=objVenue["venueName"].ToString();
                        bus.Business_Address=objVenue["address"].ToString();
                        bus.Business_TypeID=int.Parse(objVenue["venueTypeID"].ToString());
                        bus.Business_ContactPerson = objVenue["contactPeople"].ToString();
                        bus.Business_North = objVenue["site_North"].ToString();
                        bus.Business_East = objVenue["site_East"].ToString();
                        bus.Business_Email = objVenue["email"].ToString();
                        bus.Business_ContactPhone= objVenue["phone"].ToString();
                        bus.Business_PayTypeID = int.Parse(objVenue["payType"].ToString());
                        bus.Business_WebSite = objVenue["website"].ToString();
                        bus.Business_PostalCode = objVenue["postcode"].ToString();
                        bus.Business_Fax = objVenue["fax"].ToString();

                        db.AddTotbl_sys_businessman(bus);
                        if (db.SaveChanges() != 0)
                        {
                            returnStr = KeyManager.RetrunSucceed;
                        }
                        else
                        {
                            returnStr = KeyManager.RetrunUnSucceed;
                        }

                    }
                    else
                    {
                        returnStr = saveUserReturn;
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "新增场所成功,venuesinfo=" + venueInfo + ";错误信息:" + e.Message, loginUserInfo);
            }

            return returnStr;
        }