Example #1
0
        /// <summary>
        /// 更新商业伙伴信息
        /// </summary>
        /// <param name="Company">商业伙伴对象</param>
        /// <returns></returns>
        public string UpdCompanyInformation(T_Company information, List <T_BankAccount> bankItems)
        {
            information.C_GUID = Session["CurrentCompanyGuid"].ToString();
            bool   result = new CompanySvc().UpdCompanyInformation(information);
            string msg    = string.Empty;

            if (result)
            {
                Session["Taxpayer"] = information.Taxpayer;
                BankAccountSvc bankAccount = new BankAccountSvc();
                if (bankItems != null)
                {
                    foreach (T_BankAccount account in bankItems)
                    {
                        if (string.IsNullOrEmpty(account.BA_GUID))
                        {
                            account.BA_GUID = Guid.NewGuid().ToString();
                        }
                        account.C_GUID = Session["CurrentCompanyGuid"].ToString();
                        //account.AccountType = string.Empty;
                        bankAccount.UpdBankAccount(account);
                    }
                }

                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
Example #2
0
        /// <summary>
        /// 保存公司信息
        /// </summary>
        /// <param name="form">公司对象</param>
        public string UpdCompany(T_Company form)
        {
            string msg    = string.Empty;
            bool   result = false;

            form.AuditDate = DateTime.Now.ToString();
            if (string.IsNullOrEmpty(form.C_GUID) == true)
            {
                form.C_GUID            = Guid.NewGuid().ToString();
                form.MasterCompanyGuid = Session["MasterCompanyGuid"].ToString();
            }
            else
            {
                form.MasterCompanyGuid = "";
            }
            if (string.IsNullOrEmpty(form.MasterCompanyGuid) == true)
            {
                form.MasterCompanyGuid = Session["MasterCompanyGuid"].ToString();
            }
            List <T_Company> info = new List <T_Company>();

            info = new CompanySvc().GetCompanyInfo("", form.Name);
            if (info.Count.Equals(0))
            {
                result = new CompanySvc().UpdCompany(form);
                if (result)
                {
                    msg = General.Resource.Common.Success;
                }
                else
                {
                    msg = General.Resource.Common.Failed;
                }
                return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                     , result.ToString().ToLower(), msg));
            }
            else
            {
                if (info.FirstOrDefault().C_GUID == form.C_GUID)
                {
                    result = new CompanySvc().UpdCompany(form);
                    if (result)
                    {
                        msg = General.Resource.Common.Success;
                    }
                    else
                    {
                        msg = General.Resource.Common.Failed;
                    }
                    return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                         , result.ToString().ToLower(), msg));
                }
                result = false;
                msg    = General.Resource.Common.CompanyName + General.Resource.Common.Exist;
                return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}",
                                     result.ToString().ToLower(), msg));
            }
        }
        public string UpdBusinessLicense(string path)
        {
            bool   result = new CompanySvc().UpdBusinessLicense(Session["CurrentCompany"].ToString(), path);
            string msg    = string.Empty;

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
        /// <summary>
        /// 更新商业伙伴信息
        /// </summary>
        /// <param name="Company">商业伙伴对象</param>
        /// <returns></returns>
        public string UpdCompanyInformation(T_Company information)
        {
            bool   result = new CompanySvc().UpdCompanyInformation(information);
            string msg    = string.Empty;

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
Example #5
0
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="id">用户标识</param>
        public string UpdateUser(T_User form)
        {
            form.U_GUID      = Guid.NewGuid().ToString();
            form.C_GUID      = Session["MasterCompanyGuid"].ToString();
            form.Password    = "******";
            form.EnterC_GUID = Session["CurrentCompanyGuid"].ToString();
            form.State       = 0;
            bool   result = new CompanySvc().UpdUser(form);
            string msg    = string.Empty;

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
        ///<summary>
        ///保存公司设置信息
        ///<summary>
        ///<param name="form">公司设置对象</param>
        public string UpdSetting(T_CompanySetting form)
        {
            bool result = false;

            form.R_GUID          = Guid.NewGuid().ToString();
            form.ReportStartDate = new DateTime(form.Year, form.Month, 1);
            form.AuditDate       = GetNowDate();
            result = new CompanySvc().UpdSetting(form);
            string msg = string.Empty;

            if (result)
            {
                msg = General.Resource.Common.Success;
            }
            else
            {
                msg = General.Resource.Common.Failed;
            }
            return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                 , result.ToString().ToLower(), msg));
        }
        /// <summary>
        /// 保存用户信息
        /// </summary>
        /// <param name="form">用户对象</param>
        public string UpdUserInfo(T_User form)
        {
            bool          result = false;
            string        msg    = string.Empty;
            List <T_User> info   = new List <T_User>();

            info = new CompanySvc().GetUserInfo("", form.LoginName);
            if (string.IsNullOrEmpty(form.C_GUID))
            {
                form.C_GUID = Session["MasterCompanyGuid"].ToString();
                if (info.Count.Equals(0))
                {
                    result = new CompanySvc().UpdUserInfo(form);
                    if (result)
                    {
                        msg = General.Resource.Common.Success;
                    }
                    else
                    {
                        msg = General.Resource.Common.Failed;
                    }
                }
                else
                {
                    msg = Common.Resource.RolePermission.LoginName + General.Resource.Common.Exist;
                }
                return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                     , result.ToString().ToLower(), msg));
            }
            else
            {
                if (info.Count.Equals(0))
                {
                    result = new CompanySvc().UpdUserInfo(form);
                    if (result)
                    {
                        msg = General.Resource.Common.Success;
                    }
                    else
                    {
                        msg = General.Resource.Common.Failed;
                    }
                    return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                         , result.ToString().ToLower(), msg));
                }
                else
                {
                    if (info.FirstOrDefault().C_GUID == form.C_GUID & info.FirstOrDefault().U_GUID == form.U_GUID)
                    {
                        result = new CompanySvc().UpdUserInfo(form);
                        if (result)
                        {
                            msg = General.Resource.Common.Success;
                        }
                        else
                        {
                            msg = General.Resource.Common.Failed;
                        }
                        return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
                                             , result.ToString().ToLower(), msg));
                    }
                    result = false;
                    msg    = Common.Resource.RolePermission.LoginName + General.Resource.Common.Exist;
                    return(string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}",
                                         result.ToString().ToLower(), msg));
                }
            }
        }