protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        PurchaseAskPriceModel PurchaseAskPriceM = new PurchaseAskPriceModel();

        PurchaseAskPriceM.CompanyCD  = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        PurchaseAskPriceM.AskNo      = txtAskNo.Value;
        PurchaseAskPriceM.AskTitle   = txtAskTitle.Value;
        PurchaseAskPriceM.FromType   = ddlFromType.Value;
        PurchaseAskPriceM.DeptID     = hidDeptID.Value;
        PurchaseAskPriceM.AskUserID  = hidUserID.Value;
        PurchaseAskPriceM.BillStatus = ddlBillStatus.Value;
        PurchaseAskPriceM.ProviderID = hidProviderID.Value;
        PurchaseAskPriceM.FlowStatus = ddlFlowStatus.Value;
        PurchaseAskPriceM.AskDate    = StartAskDate.Value;
        PurchaseAskPriceM.EndAskDate = EndAskDate.Value;
        PurchaseAskPriceM.EFDesc     = GetBillExAttrControl1.GetExtTxtValue;
        PurchaseAskPriceM.EFIndex    = GetBillExAttrControl1.GetExtIndexValue;

        string    OrderBy = hidOrderBy.Value;
        DataTable dt      = PurchaseAskPriceBus.GetPurchaseAskPrice(PurchaseAskPriceM, OrderBy);


        OutputToExecl.ExportToTableFormat(this, dt,
                                          new string[] { "询价单编号", "询价单主题", "供应商", "询价日期", "询价员", "当前询价次数", "金额合计", "税额合计", "含税金额合计", "单据状态", "审批状态" },
                                          new string[] { "AskNo", "AskTitle", "ProviderName", "AskDate", "AskUserName", "AskOrder", "TotalPrice", "TotalTax", "TotalFee", "BillStatusName", "FlowStatusName" },
                                          "采购询价单列表");
    }
Exemplo n.º 2
0
        public static DataTable GetPurchaseAskPrice(PurchaseAskPriceModel PurchaseAskPriceM, string OrderBy)
        {
            try
            {
                DataTable dt = PurchaseAskPriceDBHelper.SelectPurAskPricePri(PurchaseAskPriceM, OrderBy);
                //DataColumn JoinName = new DataColumn();
                //dt.Columns.Add("IsCite");
                //for (int i = 0; i < dt.Rows.Count; i++)
                //{
                //    string ID = dt.Rows[i]["ID"].ToString();

                //    bool IsCite = PurchaseAskPriceDBHelper.IsCite(ID);

                //    dt.Rows[i]["IsCite"] = IsCite;
                //}
                return(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 扩展属性保存操作
        /// </summary>
        /// <returns></returns>
        private static void GetExtAttrCmd(PurchaseAskPriceModel model, Hashtable htExtAttr, SqlCommand cmd)
        {
            try
            {
                string strSql = string.Empty;

                strSql = "UPDATE officedba.PurchaseAskPrice set ";
                foreach (DictionaryEntry de in htExtAttr)// fileht为一个Hashtable实例
                {
                    strSql += de.Key.ToString().Trim() + "=@" + de.Key.ToString().Trim() + ",";
                    cmd.Parameters.AddWithValue("@" + de.Key.ToString().Trim(), de.Value.ToString().Trim());
                }
                int iLength = strSql.Length - 1;
                strSql  = strSql.Substring(0, iLength);
                strSql += " where CompanyCD = @CompanyCD  AND AskNo = @AskNo";
                cmd.Parameters.AddWithValue("@CompanyCD", ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD);
                cmd.Parameters.AddWithValue("@AskNo", model.AskNo);
                cmd.CommandText = strSql;
            }
            catch (Exception)
            { }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 插入采购询价单
        /// </summary>
        /// <param name="PurchaseAskPriceM">采购询价单主表model</param>
        /// <param name="PurchaseAskPriceDetailMList">采购询价单明细表model列表</param>
        /// <returns>bool</returns>
        public static bool InsertPurchaseAskPrice(PurchaseAskPriceModel PurchaseAskPriceM
                                                  , List <PurchaseAskPriceDetailModel> PurchaseAskPriceDetailMList, out int IndexIDentity, Hashtable htExtAttr)
        {
            try
            {
                ArrayList  lstAdd = new ArrayList();
                SqlCommand AddPri = PurchaseAskPriceDBHelper.InsertPurAskPricePri(PurchaseAskPriceM);
                lstAdd.Add(AddPri);
                foreach (PurchaseAskPriceDetailModel PurchaseAskPriceDetailM in PurchaseAskPriceDetailMList)
                {
                    SqlCommand AddDtl = PurchaseAskPriceDBHelper.InsertPurAskPriceDetail(PurchaseAskPriceDetailM);
                    lstAdd.Add(AddDtl);
                }

                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseAskPriceM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                {
                    lstAdd.Add(cmd);
                }
                #endregion

                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstAdd);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }


                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark        = ConstUtil.LOG_PROCESS_SUCCESS;
                    IndexIDentity = int.Parse(((SqlCommand)AddPri).Parameters["@IndexID"].Value.ToString());
                }
                else
                {
                    //设置操作成功标识
                    remark        = ConstUtil.LOG_PROCESS_FAILED;
                    IndexIDentity = 0;
                }

                LogInfoModel logModel = InitLogInfo(PurchaseAskPriceM.AskNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新采购询价单
        /// </summary>
        /// <param name="PurchaseAskPriceM">采购询价单主表model</param>
        /// <param name="PurchaseAskPriceDetailMList">采购询价单明细表model列表</param>
        /// <returns>bool</returns>
        ///
        public static bool UpdatePurchaseAskPrice(PurchaseAskPriceModel PurchaseAskPriceM
                                                  , List <PurchaseAskPriceDetailModel> PurchaseAskPriceDetailMList, Hashtable htExtAttr)
        {
            try
            {
                ArrayList lstUpdate = new ArrayList();
                if (PurchaseAskPriceM.AskAgain == "1")
                {//再次询价,需将此次询价之前的那次询价记录记入询价历史表
                    SqlCommand AskAgain = PurchaseAskPriceDBHelper.InsertPurchaseAskHistory(PurchaseAskPriceM.ID);
                    lstUpdate.Add(AskAgain);
                }
                SqlCommand UpdatePri = PurchaseAskPriceDBHelper.UpdatePurAskPricePri(PurchaseAskPriceM);
                lstUpdate.Add(UpdatePri);
                #region 拓展属性
                SqlCommand cmd = new SqlCommand();
                GetExtAttrCmd(PurchaseAskPriceM, htExtAttr, cmd);
                if (htExtAttr.Count > 0)
                {
                    lstUpdate.Add(cmd);
                }
                #endregion

                SqlCommand DelDtl = PurchaseAskPriceDBHelper.DeletePurAskPriceDetail(PurchaseAskPriceM.AskNo);
                lstUpdate.Add(DelDtl);
                foreach (PurchaseAskPriceDetailModel PurchaseAskPriceDetailM in PurchaseAskPriceDetailMList)
                {
                    SqlCommand AddDtl = PurchaseAskPriceDBHelper.InsertPurAskPriceDetail(PurchaseAskPriceDetailM);
                    lstUpdate.Add(AddDtl);
                }

                //获取登陆用户信息
                UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
                //定义返回变量
                bool isSucc = false;

                /*
                 * 定义日志内容变量
                 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
                 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
                 */

                //执行插入操作
                try
                {
                    isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate);
                }
                catch (Exception ex)
                {
                    //输出日志
                    WriteSystemLog(userInfo, ex);
                }


                //定义变量
                string remark;
                //成功时
                if (isSucc)
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_SUCCESS;
                }
                else
                {
                    //设置操作成功标识
                    remark = ConstUtil.LOG_PROCESS_FAILED;
                }

                LogInfoModel logModel = InitLogInfo(PurchaseAskPriceM.AskNo);
                //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
                logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                //设置操作成功标识
                logModel.Remark = remark;

                //登陆日志
                LogDBHelper.InsertLog(logModel);
                return(isSucc);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }