Exemplo n.º 1
0
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        //设置行为参数
        string orderString = hiddExpOrder.Value.Trim();                                                                                //排序
        string order       = "desc";                                                                                                   //排序:降序
        string orderBy     = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "ModifiedDate"; //要排序的字段,如果为空,默认为"ID"

        if (orderString.EndsWith("_a"))
        {
            order = "asc";                                       //排序:升序
        }
        int       pageCount     = int.Parse(hiddExpTotal.Value); //每页显示记录数
        int       pageIndex     = 1;                             //当前页
        int       TotalCount    = 0;                             //总记录数
        string    ord           = orderBy + " " + order;         //排序字段
        DataTable dt            = new DataTable();
        string    strPlanNo     = hiddExpOrderNo.Value.Trim();
        string    strTitle      = hiddExpTitle.Value.Trim();
        string    strPlanType   = hiddExpFromType.Value.Trim();
        string    strBillStatus = hiddExpBillStatus.Value.Trim();
        string    strFlowStatus = hiddExpFlowStatus.Value.Trim();

        string OfferNo    = strPlanNo.Length == 0 ? null : strPlanNo;
        string Title      = strTitle.Length == 0 ? null : strTitle;
        string PlanType   = strPlanType.Length == 0 ? null : strPlanType;
        string BillStatus = strBillStatus.Length == 0 ? null : strBillStatus;
        int?   FlowStatus = strFlowStatus.Length == 0 ? null : (int?)Convert.ToInt32(strFlowStatus);

        string EFIndex = hidEFIndex.Value;
        string EFDesc  = hidEFDesc.Value;

        SellPlanModel model = new SellPlanModel();

        model.BillStatus = BillStatus;
        model.PlanType   = PlanType;
        model.PlanNo     = strPlanNo;
        model.Title      = Title;
        dt = SellPlanBus.GetOrderList(EFIndex, EFDesc, model, FlowStatus, pageIndex, pageCount, ord, ref TotalCount);

        //导出标题
        string headerTitle = "计划编号|计划名称|计划类型|计划时期|最低计划额(元)|计划总金额(元)|单据状态|审批状态";

        //string headerTitle = "建档日期|启用状态";
        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "PlanNo|Title|PlanTypeText|PlanDate|MinPlanTotal|PlanTotal|BillStatusText|FlowInstanceText";

        string[] field = columnFiled.Split('|');

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "销售计划列表");
    }
Exemplo n.º 2
0
        /// <summary>
        /// 更新销售发货单
        /// </summary>
        /// <returns></returns>
        public static bool Update(Hashtable ht, SellPlanModel sellPlanModel, SellPlanDetailModel sellPlanDetail, string strDetailAction, out string strMsg)
        {
            bool isSucc = false;//是否添加成功
            //定义变量
            string remark = string.Empty;

            strMsg = "";
            try
            {
                isSucc = SellPlanDBHelper.Update(ht, sellPlanModel, sellPlanDetail, strDetailAction, out strMsg);
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            catch (Exception ex)
            {
                //输出日志
                SellLogCommon.WriteSystemLog(ex, LogInfo.LogType.SYSTEM, LogInfo.SystemLogKind.SYSTEM_ERROR, "2031001");
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            SellLogCommon.InsertLog(sellPlanModel.PlanNo, "2031001", "officedba.SellPlan", remark, ConstUtil.LOG_PROCESS_UPDATE);
            return(isSucc);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 获取单据列表
 /// </summary>
 /// <param name="sellOfferModel">sellOfferModel表实体</param>
 /// <param name="FlowStatus">审批状态</param>
 /// <returns></returns>
 public static DataTable GetOrderList(string EFIndex, string EFDesc, SellPlanModel sellPlanModel, int?FlowStatus, int pageIndex, int pageCount, string ord, ref int TotalCount)
 {
     return(SellPlanDBHelper.GetOrderList(EFIndex, EFDesc, sellPlanModel, FlowStatus, pageIndex, pageCount, ord, ref TotalCount));
 }
Exemplo n.º 4
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel model = new PrintParameterSettingModel();

        model.CompanyCD     = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SALE);
        model.PrintTypeFlag = ConstUtil.PRINTBILL_SELLPLAN;

        SellPlanModel modelMRP = new SellPlanModel();

        modelMRP.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        modelMRP.ID        = this.intMrpID;

        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"       },
            { "{ExtField2}",  "ExtField2"       },
            { "{ExtField3}",  "ExtField3"       },
            { "{ExtField4}",  "ExtField4"       },
            { "{ExtField5}",  "ExtField5"       },
            { "{ExtField6}",  "ExtField6"       },
            { "{ExtField7}",  "ExtField7"       },
            { "{ExtField8}",  "ExtField8"       },
            { "{ExtField9}",  "ExtField9"       },
            { "{ExtField10}", "ExtField10"      },

            { "计划编号",         "PlanNo"          },
            { "计划名称",         "Title"           },
            { "计划类型",         "PlanType"        },

            { "计划时期",         "PlanTime"        },
            { "开始时间",         "StartDate"       },
            { "结束时间",         "EndDate"         },

            { "最低计划额(元)",     "MinPlanTotal"    },
            { "计划总金额(元)",     "PlanTotal"       },

            { "激励方案",         "Hortation"       },

            { "可查看人员",        "CanViewUserName" },

            { "单据状态",         "BillStatus"      },
            { "制单人",          "Creator"         },
            { "制单日期 ",        "CreateDate"      },

            { "确认人",          "Confirmor"       },
            { "确认日期",         "ConfirmDate"     },
            { "结单人",          "Closer"          },

            { "结单日期",         "CloseDate"       },
            { "最后更新人",        "ModifiedUserID"  },
            { "最后更新日期",       "ModifiedDate"    },

            { "备注",           "Remark"          },
        };

        string[,] aDetail =
        {
            { "部门/物品/人员", "DetailTypeName"  },
            { "名称",       "DetailName"      },
            { "最低目标额(元)", "MinDetailotal"   },
            { "目标额(元)",   "DetailTotal"     },
            { " 完成情况",    "AddOrCutText2"   },
            { "目标达成率",    "CompletePercent" },
        };

        #region 1.扩展属性
        int       countExt   = 0;
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD, "", "officedba.SellPlan");
        if (dtExtTable.Rows.Count > 0)
        {
            for (int i = 0; i < dtExtTable.Rows.Count; i++)
            {
                for (int x = 0; x < (aBase.Length / 2) - 15; x++)
                {
                    if (x == i)
                    {
                        aBase[x, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
                        countExt++;
                    }
                }
            }
        }
        #endregion


        DataTable dbPrint         = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(model);
        DataTable dtMRP           = SellPlanBus.GetRepOrder(PlanNo);    //主表 MRPBus.GetMRPInfo(modelMRP);
        DataTable dtDetail        = SellPlanBus.GetOrderDetail(PlanNo); //明细表 MRPBus.GetMRPDetailInfo(modelMRP);
        string    strBaseFields   = "";
        string    strDetailFields = "";

        if (dbPrint.Rows.Count > 0)
        {
            isSeted.Value   = "1";
            strBaseFields   = dbPrint.Rows[0]["BaseFields"].ToString();
            strDetailFields = dbPrint.Rows[0]["DetailFields"].ToString();
        }
        else
        {
            isSeted.Value = "0";
            strBaseFields = "PlanNo|Title|PlanType|PlanTime|StartDate|EndDate|MinPlanTotal|PlanTotal|Hortation|CanViewUserName|BillStatus|Creator|CreateDate|Confirmor|ConfirmDate|Closer|CloseDate|ModifiedUserID|ModifiedDate|Remark";
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields = strBaseFields + "|" + "ExtField" + (i + 1);
                }
            }

            strDetailFields = "DetailTypeName|DetailName|MinDetailotal|DetailTotal|AddOrCutText2|CompletePercent";
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("销售计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("销售计划", strBaseFields, strDetailFields, aBase, aDetail, dtMRP, dtDetail, false);
        }
        #endregion
    }