private void BindSourceData()
        {
            try
            {
                //提成比率
                pts_proj_ratio[] arr = pts_proj_ratioDao.FindAll();
                if (arr.Length > 0)
                {
                    for (int i = 0; i < arr.Length; i++)
                    {
                        ucRatio uc = new ucRatio(arr[i].ID.ToString(), arr[i]);
                        uc.DelSelectRatio += uc_DelSelectRatio;
                        this.panel1.Children.Add(uc);
                    }
                }

                //项目成本
                PTS_PROJ_COST[] arr2 = PTS_PROJ_COSTDAO.FindAll();
                if (arr2.Length > 0)
                {
                    for (int i = 0; i < arr2.Length; i++)
                    {
                        ucProjCost uc = new ucProjCost(arr2[i].ID.ToString(), arr2[i]);
                        uc.DelSelectCost += uc_DelSelectCost;
                        this.panel2.Children.Add(uc);
                    }
                }

                //可分配比例
                PTS_OBJECT_TYPE_SRC[] arr3 = PTS_OBJECT_TYPE_SRCDAO.FindAll(new EqExpression("STATUS", 1));
                if (arr3.Length > 0)
                {
                    for (int i = 0; i < arr3.Length; i++)
                    {
                        ucRatio3 uc = new ucRatio3(arr3[i]);
                        uc.DelSelectRatio += uc_DelSelectRatio;
                        this.panel3.Children.Add(uc);
                    }
                }
                //if (src != null)
                //{
                //    mSrc = src;
                //    this.txtRatio_1.Text = src.RATIO1.ToString();
                //    this.txtRatio_2.Text = src.RATIO2.ToString();
                //}
            }
            catch (Exception ex)
            {
                MessageHelper.ShowMessage(ex.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 项目成本费用
        /// </summary>
        /// <param name="money">合同金额</param>
        /// <returns></returns>
        public static decimal QueryProjCost(decimal money)
        {
            decimal rtn = 0;

            try
            {
                PTS_PROJ_COST[] list = PTS_PROJ_COSTDAO.FindAll();
                for (int i = 0; i < list.Length; i++)
                {
                    decimal key1 = decimal.Parse(list[i].KEY1);
                    decimal key2 = decimal.Parse(list[i].KEY2);
                    if (key1 < key2)
                    {
                        if (money < key2 && money >= key1)
                        {
                            return(decimal.Parse(list[i].COST));
                        }
                    }
                    else if (key2 < key1)
                    {
                        if (money < key1 && money >= key2)
                        {
                            return(decimal.Parse(list[i].COST));
                        }
                    }
                    else
                    {
                        return(rtn);
                    }
                }
                return(rtn);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }