public string UpdExpenseTypeRecord(string id, string etguid, string expensetype, string expenseflag, string saleflag, string manageflag, string financeflag, string otherFlag, string taxflag)
        {
            bool          result = false;
            string        msg    = string.Empty;
            T_ExpenseType form   = new T_ExpenseType();

            form.ET_GUID     = etguid;
            form.ExpenseType = expensetype;
            form.ExpenseFlag = expenseflag;
            form.SaleFlag    = saleflag;
            form.ManageFlag  = manageflag;
            form.FinanceFlag = financeflag;
            form.OtherFlag   = otherFlag;
            form.TaxFlag     = taxflag;
            result           = new DetailSvc().UpdExpenseTypeRecord(form, id);
            if (result)
            {
                return("success");
            }
            else
            {
                msg = General.Resource.Common.Failed;
                return("failed");
            }
            //return string.Format("{{\"Result\":{0},\"Msg\":\"{1}\"}}"
            //    , result.ToString().ToLower(), msg);
        }
        public string GetExpenseTypeRecord(string id)
        {
            //string C_GUID = Session["CurrentCompanyGuid"].ToString();
            T_ExpenseType rec  = new DetailSvc().GetExpenseTypeRecord(id);
            string        json = new JavaScriptSerializer().Serialize(rec);

            return(json);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取费用列表
        /// </summary>
        /// <param name="rows">页大小</param>
        /// <param name="page">页索引</param>
        /// <returns></returns>
        public string GetDetailList(string rows, string page)
        {
            int           count                 = 0;
            string        strFormatter          = "{{\"total\":\"{0}\",\"rows\":{1}}}";
            StringBuilder strJson               = new StringBuilder();
            List <T_DetailedCategories> IERcord = new List <T_DetailedCategories>();

            IERcord = new DetailSvc().GetDetailList(int.Parse(page), int.Parse(rows), out count);
            strJson.AppendFormat(strFormatter, count, new JavaScriptSerializer().Serialize(IERcord));
            return(strJson.ToString());
        }
        public string GetExpenseTypeList()
        {
            int count = 0;
            //string strFormatter = "{{\"total\":\"{0}\",\"rows\":{1}}}";
            StringBuilder        strJson = new StringBuilder();
            List <T_ExpenseType> List    = new List <T_ExpenseType>();

            List = new DetailSvc().GetExpenseTypeList(Session["CurrentCompanyGuid"].ToString(), out count);
            string json = new JavaScriptSerializer().Serialize(List);

            return(json);
        }
        public string DelExpenseTypeRecord(string id)
        {
            bool   result = new DetailSvc().DelExpenseTypeRecord(id);
            string msg    = string.Empty;

            if (result)
            {
                return("success");
            }
            else
            {
                return("failed");
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 更新类别启用状态
        /// </summary>
        /// <param name="guid">纪录标识</param>
        /// <param name="state">状态</param>
        /// <returns></returns>
        public string UpdDetailstate(string guid, string state)
        {
            bool   result = new DetailSvc().UpdDetailstate(guid, state);
            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));
        }
Esempio n. 7
0
        /// <summary>
        /// 新增类别
        /// </summary>
        /// <returns></returns>
        public string UpdDetail(string guid, string name)
        {
            T_DetailedCategories detail = new T_DetailedCategories();

            detail.GUID  = guid;
            detail.Name  = name;
            detail.State = "启用";
            bool   result = new DetailSvc().UpdDetail(detail);
            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));
        }
Esempio n. 8
0
        public bool AddNewCompany(FormCollection form)
        {
            bool result = false;

            List <T_Company> Info = new List <T_Company>();

            Info = new CompanySvc().GetCompanyInfo("", form["CompanyID"]);
            if (Info.Count.Equals(0))
            {
                //创建
                //UpdCompany
                T_Company company = new T_Company();

                company.C_GUID    = Guid.NewGuid().ToString();
                Session["C_GUID"] = company.C_GUID;
                company.Name      = form["Name"];
                company.Taxpayer  = form["TaxO"];
                company.CompanyID = form["CompanyID"];
                string address = form["country"] + "-" + form["province"] + "-" + form["city"];
                company.Address    = address;
                company.Country    = form["country"];
                company.Province   = form["province"];
                company.City       = form["city"];
                company.Contacter  = "";
                company.ContactWay = "";
                company.Type       = "";
                company.AuditDate  = DateTime.Today.ToString();

                if (new CompanySvc().UpdCompany(company, "", Session["CurrentUserGuid"].ToString()))
                {
                    AddCompanyCurrency(company.C_GUID, form["Currency"]);


                    AddCompanySetting(company.C_GUID, form["Currency"]);

                    if (Session["CurrentCompanyGuid"].ToString() == "")
                    {
                        Session["CurrentCompanyGuid"] = company.C_GUID;
                    }
                    Session["Currency"] = form["Currency"];

                    int count = 0;
                    List <T_ExpenseType> List = new List <T_ExpenseType>();
                    string cid = "66666666-6666-6666-6666-666666666666";
                    List = new DetailSvc().GetExpenseTypeList(cid, out count);
                    string id = company.C_GUID.ToString();
                    for (var i = 0; i < List.Count; i++)
                    {
                        string        newID = Guid.NewGuid().ToString();
                        T_ExpenseType form1 = new T_ExpenseType();
                        form1.ET_GUID     = newID;
                        form1.ExpenseType = List[i].ExpenseType;
                        form1.ExpenseFlag = List[i].ExpenseFlag;
                        form1.SaleFlag    = List[i].SaleFlag;
                        form1.ManageFlag  = List[i].ManageFlag;
                        form1.FinanceFlag = List[i].FinanceFlag;
                        form1.OtherFlag   = List[i].OtherFlag;
                        form1.TaxFlag     = List[i].TaxFlag;
                        result            = new DetailSvc().UpdExpenseTypeRecord(form1, id);
                    }
                    List <T_Tax> ListTax = new List <T_Tax>();
                    ListTax = new TaxSvc().GetTax(cid);
                    for (var i = 0; i < ListTax.Count; i++)
                    {
                        string newID = Guid.NewGuid().ToString();
                        T_Tax  form2 = new T_Tax();
                        form2.T_GUID = newID;
                        form2.Name   = ListTax[i].Name;
                        form2.Rate   = ListTax[i].Rate;
                        form2.Type   = ListTax[i].Type;
                        form2.C_GUID = id;
                        new TaxSvc().UpdTax(form2);
                    }
                    //List<T_RateHistory> RateList = new List<T_RateHistory>();
                    //RateList = new CurrencySvc().GetRateModel(cid,form["Currency"]);
                    //for (var i = 0; i < RateList.Count; i++)
                    //{
                    //    string newID = Guid.NewGuid().ToString();
                    //    T_RateHistory form3 = new T_RateHistory();
                    //    form3.GUID = newID;
                    //    form3.FAmount = RateList[i].FAmount;
                    //    form3.FCurrency = RateList[i].FCurrency;
                    //    form3.TAmount = RateList[i].TAmount;
                    //    form3.TCurrency = RateList[i].TCurrency;
                    //    form3.CurrentRecord = RateList[i].CurrentRecord;
                    //    form3.Currency = RateList[i].Currency;
                    //    form3.Rate = RateList[i].Rate;
                    //    form3.TRate = RateList[i].TRate;
                    //    form3.C_GUID = id;
                    //    new CurrencySvc().UpdRateHistory(form3);
                    //}


                    /*添加快速关注模板(新建model以及表)**/
                    new AccountSvc().UpdIntAccount(cid, id);

                    string Nowtime = GetMinutesDate().ToString();
                    List <T_QuickAttention> QuickAttenList = new List <T_QuickAttention>();
                    QuickAttenList = new ReportSvc().GetQuickAttentionModel(cid);
                    for (var i = 0; i < QuickAttenList.Count; i++)
                    {
                        string           newID = Guid.NewGuid().ToString();
                        T_QuickAttention form4 = new T_QuickAttention();
                        form4.id                    = newID;
                        form4.c_guid                = id;
                        form4.attention_type        = QuickAttenList[i].attention_type;
                        form4.attention_type_amount = QuickAttenList[i].attention_type_amount;
                        form4.statistical_time      = Convert.ToDateTime(Nowtime);
                        form4.statistical_currency  = QuickAttenList[i].statistical_currency;
                        form4.attention_state       = QuickAttenList[i].attention_state;
                        form4.push_account          = QuickAttenList[i].push_account;
                        form4.push_frequency        = QuickAttenList[i].push_frequency;
                        form4.company_name          = QuickAttenList[i].company_name;
                        new ReportSvc().UpdQuickAttention(form4);
                    }
                    result = true;
                }
            }
            else
            {
                result = false;
            }
            return(result);
        }