Пример #1
0
        /// <summary>
        /// 编辑收付款信息(Finance_Edit页面)
        /// </summary>
        public ActionResult Edit_Finance()
        {
            FinanceFactory financefactory = new FinanceFactory();
            //获取收付款编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IFinanceB financeb = financefactory.GetDataByID(id);
            FinanceM  financem = (financeb == null ? null : financeb.Infomation_finance);
            //编辑收付款信息
            string financename   = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string financebelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();

            //financem.SFName = financename;
            //financem.SFBelong = financebelong;
            financefactory.Infomation_finance = financem;
            ViewBag.FinanceInfo = financem;
            bool isSuccess = financefactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Finance/Finance"));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Пример #2
0
        /// <summary>
        /// 转换成业务逻辑层的对象
        /// </summary>
        /// <param name="financen">集团内收付款信息(模型层)</param>
        /// <returns>(业务逻辑层)对象</returns>
        IFinanceB ConvertToFinance_B(FinanceM financem)
        {
            IFinanceB result = null;

            if (financem != null)
            {
                result = new FinanceB(financem, this._connectionb);
            }
            return(result);
        }
Пример #3
0
        /// <summary>
        /// Finance_Edit页面行为
        /// </summary>
        /// <returns>视图</returns>
        public ActionResult Finance_Edit()
        {
            //获取收付款编号(id)数据信息
            string         id             = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();
            FinanceFactory financefactory = new FinanceFactory();
            IFinanceB      lstFinance     = financefactory.GetDataByID(id);
            FinanceM       financem       = (lstFinance != null ? lstFinance.Infomation_finance : null);

            ViewBag.FinanceInfo = financem;
            return(View());
        }
Пример #4
0
        /// <summary>
        /// 判断收付款是否存在
        /// </summary>
        /// <param name="financename">收付款名</param>
        /// <returns>收付款类</returns>
        public bool IsExist_financename(string financename)
        {
            bool     isExist_financename = false;
            FinanceM financem            = this._financeb.IsExist_financename(financename);

            if (financem != null)
            {
                this.Infomation_finance = financem;
                isExist_financename     = true;
            }
            return(isExist_financename);
        }
Пример #5
0
        /// <summary>
        /// 判断收付款是否存在
        /// </summary>
        /// <param name="financenname">收付款名</param>
        /// <param name="connection">链接类</param>
        /// <returns>收付款类</returns>
        public static FinanceM IsExist_financename(string financename, IConnectionD connection)
        {
            FinanceM result = null;

            string where = string.Format(" and {0}='{1}'", TableStructM.Info_Finance.SF_CNID, financename.ReplaceStr());
            IList <FinanceM> lst = ReadDataBase(where, connection);

            if (lst != null)
            {
                result = lst.FirstOrDefault();
            }
            return(result);
        }
Пример #6
0
        /// <summary>
        /// 将数据行中的数据添加到对象中
        /// </summary>
        /// <param name="row">数据行</param>
        /// <param name="alias">表别名</param>
        /// <returns>数据</returns>
        public static FinanceM AddDataToObject(DataRow row, string alias)
        {
            FinanceM result = new FinanceM();

            result.SFID         = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_ID, alias)].ConvertToInt32();
            result.SFCOLLECTPAY = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_COLLECTPAY, alias)].ConvertToInt32();
            result.SFPRID       = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_PRID, alias)].ConvertToInt32();
            result.SFCNID       = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_CNID, alias)].ConvertToInt32();
            result.SFCLID       = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_CLID, alias)].ConvertToInt32();
            result.SFDATE       = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_DATE, alias)].ConvertToDateTime();
            result.SFMONEY      = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_PRID, alias)].ConvertToDecimal();
            result.SFACCOUNT    = row[CommonMethods.CombineFieldAlias(TableStructM.Info_Finance.SF_PRID, alias)].ToString();
            // result.SetOnOff(row[CommonMethods.CombineFieldAlias(TableStructM.Info_Menu.MN_ONOFF, alias)].ConvertToInt32());

            return(result);
        }
Пример #7
0
        /// <summary>
        /// 删除收付款信息(Finance页面)
        /// </summary>
        /// <returns></returns>
        public ActionResult Delete_Finance()
        {
            //获取收付款编号(id)信息
            string   uid      = ViewMethods.GetForm(Request, "uid", CommonEnums.ValueEnum.vlPost).ToString();
            FinanceM financem = new FinanceM();

            financem.SFID = uid.ConvertToInt32();
            FinanceFactory financefactory = new FinanceFactory();

            financefactory.Infomation_finance = financem;
            financefactory.Del_Finance();
            return(new JsonResult()
            {
                Data = PublicMethods.JSonHelper <string> .ObjectToJson(new { status = "0", msg = "删除成功" }), ContentType = "json"
            });
        }
Пример #8
0
        /// <summary>
        /// 添加收付款信息(Finance_Add页面)
        /// </summary>
        public ActionResult Add_Finance()
        {
            FinanceFactory financefactory = new FinanceFactory();
            //添加业主信息
            FinanceM financem    = new FinanceM();
            string   financename = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string   prbelong    = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            bool     isExist     = financefactory.IsExist_financename(financename);

            if (isExist)
            {
                return(ViewMethods.AlertBack("收付款已存在,请重新确认", "-1"));
            }
            //financem.SFName = financename;
            //financem.SFBelong = prbelong;
            financefactory.Infomation_finance = financem;
            financefactory.Save();
            return(ViewMethods.AlertBack("添加收付款成功!", "../../Finance/Finance"));
        }
Пример #9
0
        /// <summary>
        /// Finance_List页面行为
        /// </summary>
        /// <return>视图</return>
        public ActionResult FinanceA_List()
        {
            //获取项目信息
            ProjectsFactory   projectsfactory = new ProjectsFactory();
            List <IProjectsB> lstprojects     = projectsfactory.GetDataProjects();
            List <ProjectsM>  projectsm       = new List <ProjectsM>();

            if (lstprojects != null && lstprojects.Count > 0)
            {
                lstprojects.ForEach(p => projectsm.Add(p.Infomation_projects));
            }
            ViewBag.Projects = projectsm;

            //获取收付款单ID数据信息
            string         sfid           = "2";
            FinanceFactory financeFactory = new FinanceFactory();
            IFinanceB      lstFinance     = financeFactory.GetDataByID(sfid);
            FinanceM       financem       = (lstFinance != null ? lstFinance.Infomation_finance : null);

            ViewBag.FinanceInfo = financem;
            return(View());
        }
Пример #10
0
        /// <summary>
        /// Finance_List页面行为
        /// </summary>
        /// <return>视图</return>
        public ActionResult Finance_List()
        {
            //获取项目信息
            ProjectsFactory   projectsfactory = new ProjectsFactory();
            List <IProjectsB> lstprojects     = projectsfactory.GetDataProjects();
            List <ProjectsM>  projectsm       = new List <ProjectsM>();

            if (lstprojects != null && lstprojects.Count > 0)
            {
                lstprojects.ForEach(p => projectsm.Add(p.Infomation_projects));
            }
            ViewBag.Projects = projectsm;

            //获取收付款单ID数据信息
            string         sfid           = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();
            FinanceFactory financeFactory = new FinanceFactory();
            IFinanceB      lstFinance     = financeFactory.GetDataByID(sfid);
            FinanceM       financem       = (lstFinance != null ? lstFinance.Infomation_finance : null);

            ViewBag.FinanceInfo = financem;
            return(View());
        }
Пример #11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="info">收付款信息类(模型层)</param>
 /// <param name="connectionb">链接类</param>
 public FinanceB(FinanceM info, IConnectionB connectionb)
     : this(connectionb)
 {
     this.Infomation_finance = info;
 }
Пример #12
0
        /// <summary>
        /// 通过编号获取数据
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>数据</returns>
        public IFinanceB GetDataByID(string id)
        {
            FinanceM result = Methods.ReflexInvokeMethod(this._financed, this._methodnm_GetDataByID, new Type[] { typeof(String), typeof(IConnectionD) }, new object[] { id, this._connectionb.ConnectionD }) as FinanceM;

            return(ConvertToFinance_B(result));
        }