protected void btn_input_Click(object sender, EventArgs e)
 {
     try
     {
         if (UserInfo.EmployeeID.ToString().Length < 1)
         {
             this.lbl_jg.Text = "该用户没有分配为雇员,导入失败!";
         }
         else
         {
             SubStorageBus.ImportData(dt, UserInfo);
             this.lbl_jg.Text = "Excel数据导入成功";
         }
         this.tab_end.Visible = true;
         btn_input.Enabled    = false;
         ProductInfoBus.LogInsert(UserInfo.CompanyCD, UserInfo.DeptID, UserInfo.UserID, Request.QueryString["ModuleID"].ToString(), dt.Rows.Count, 1, "成功导入" + dt.Rows.Count.ToString() + "条数据");
     }
     catch (Exception ex)
     {
         btn_input.Enabled    = true;
         this.tab_end.Visible = true;
         this.lbl_jg.Text     = ex.Message;
         ProductInfoBus.LogInsert(UserInfo.CompanyCD, UserInfo.DeptID, UserInfo.UserID, Request.QueryString["ModuleID"].ToString(), 0, 0, this.lbl_jg.Text);
     }
 }
Exemplo n.º 2
0
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {

        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        string DeptID = this.HidDeptID.Value;
        string ProductID = this.HidProductID.Value;
        string ProductName = this.txtProductName.Text;
        string EFIndex = GetBillExAttrControl1.GetExtIndexValue;
        string EFDesc = GetBillExAttrControl1.GetExtTxtValue;

        int TotalCount = 0;
        DataTable dt = SubStorageBus.SelectSubStorageInitList(1, 1000000, "ID", ref TotalCount, DeptID, ProductID, ProductName, EFIndex, EFDesc, this.txtBatchNo.Value);


        //导出标题
        string headerTitle = "分店名称|入库单编号|入库单主题|入库数量|确认人|确认时间|单据状态";
        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "DeptName|InNo|Title|CountTotal|ConfirmorName|ConfirmDate|BillStatusName";
        string[] field = columnFiled.Split('|');

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "分店期初库存列表");
    }
Exemplo n.º 3
0
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        string StorageID = this.drpStorageName.Value;

        if (StorageID == "0")
        {
            StorageID = "";
        }
        string ProductID   = this.HidProductID.Value;
        string ProductName = this.txtProductName.Text;

        int       TotalCount = 0;
        DataTable dt         = SubStorageBus.SelectStorageProduct(1, 1000000, "ID", ref TotalCount, StorageID, ProductID, ProductName, this.txtBatchNo.Value);

        //导出标题
        string headerTitle = "仓库编号|仓库名称|物品编号|物品名称|物品分类|规格|单位|现有存量|批次";

        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "StorageNo|StorageName|ProductNo|ProductName|TypeIDName|Specification|UnitName|ProductCount|BatchNo";

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

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "总部库存查询");
    }
Exemplo n.º 4
0
    /// <summary>
    /// 绑定报表
    /// </summary>
    private void Print()
    {
        UserInfoUtil UserInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
        /*接受参数*/
        int    ID        = int.Parse(Request.QueryString["ID"].ToString());
        string CompanyCD = UserInfo.CompanyCD;
        string DeptID    = Convert.ToString(UserInfo.DeptID);
        /*读取数据*/
        DataTable dtp     = SubStorageBus.SubStorageIn(ID);
        DataTable Details = SubStorageBus.Details(ID, DeptID);

        /*绑定RPT*/
        if (dtp != null)
        {
            /*加载主报表*/
            rd.Load(Server.MapPath(@"~/PrinttingModel/SubStoreManager/PrintSubStorageInit.rpt"));
            CrystalReportViewer1.LogOnInfo.Add(ReportUtil.GetTableLogOnInfo("officedba.View_PrintSubStorageInit"));

            /*加载子报表*/
            ReportDocument rdDetail = rd.Subreports["PrintSubStorageInitDetail.rpt"];
            rdDetail.SetDataSource(Details);

            //绑定数据
            rd.SetDataSource(dtp);

            rd.Refresh();
            this.CrystalReportViewer1.ReportSource = rd;
            rd.SetParameterValue("Creator", UserInfo.UserName);
        }
    }
Exemplo n.º 5
0
    private void BinddrpStorageName()
    {
        DataTable dt = SubStorageBus.GetdrpStorageName();

        if (dt != null && dt.Rows.Count > 0)
        {
            drpStorageName.DataSource     = dt;
            drpStorageName.DataTextField  = "StorageName";
            drpStorageName.DataValueField = "ID";
            drpStorageName.DataBind();
            ListItem Item = new ListItem("--请选择--", "");
            drpStorageName.Items.Insert(0, Item);
        }
    }
Exemplo n.º 6
0
    protected void LoadPrintInfo()
    {
        PrintParameterSettingModel pModel = new PrintParameterSettingModel();

        pModel.CompanyCD     = UserInfo.CompanyCD;
        pModel.BillTypeFlag  = int.Parse(ConstUtil.BILL_TYPEFLAG_SUBSTORAGE);
        pModel.PrintTypeFlag = ConstUtil.PRINTBILL_TYPEFLAG_SUBSTORAGEIN;


        /*此处需注意在模板设置表里的字段和取基本信息的字段是否一致*/
        string[,] aBase =
        {
            { "{ExtField1}",  "ExtField1"      },
            { "{ExtField2}",  "ExtField2"      },
            { "{ExtField3}",  "ExtField3"      },
            { "{ExtField4}",  "ExtField4"      },
            { "{ExtField5}",  "ExtField5"      },
            { "{ExtField6}",  "ExtField6"      },
            { "{ExtField7}",  "ExtField7"      },
            { "{ExtField8}",  "ExtField8"      },
            { "{ExtField9}",  "ExtField9"      },
            { "{ExtField10}", "ExtField10"     },
            { "入库单编号",        "InNo"           },
            { "入库单主题",        "Title"          },
            { "分店名称",         "DeptName"       },
            { "制单人",          "CreatorName"    },
            { "制单日期",         "CreateDate"     },
            { "单据状态",         "BillStatusName" },
            { "确认人",          "ConfirmorName"  },
            { "确认日期",         "ConfirmDate"    },
            { "最后更新人",        "ModifiedUserID" },
            { "最后更新日期",       "ModifiedDate"   },
            { "备注",           "Remark"         },
        };

        string[,] aDetail =
        {
            { "序号",   "SortNo"      },
            { "物品编号", "ProductNo"   },
            { "物品名称", "ProductName" },
            { "批次",   "BatchNo"     },
            { "规格",   "standard"    },
            { "单位",   "UnitName"    },
            { "入库数量", "SendCount"   }
        };
        if (_isMoreUnit)
        {// 启用多计量单位
            aDetail = new string[, ]
            {
                { "序号", "SortNo" },
                { "物品编号", "ProductNo" },
                { "物品名称", "ProductName" },
                { "批次", "BatchNo" },
                { "规格", "standard" },
                { "基本单位", "UnitName" },
                { "基本数量", "SendCount" },
                { "单位", "UsedUnitName" },
                { "入库数量", "UsedUnitCount" }
            };
        }

        #region 扩展属性
        DataTable dtExtTable = TableExtFieldsBus.GetAllList(UserInfo.CompanyCD, "", "officedba.SubStorageIn");
        int       countExt   = 0;
        for (int i = 0; i < dtExtTable.Rows.Count; i++)
        {
            aBase[i, 0] = dtExtTable.Rows[i]["EFDesc"].ToString();
            countExt++;
        }
        #endregion

        DataTable dbPrint  = XBase.Business.Common.PrintParameterSettingBus.GetPrintParameterSettingInfo(pModel);
        DataTable dt       = SubStorageBus.SubStorageIn(intID);
        string    deptID   = UserInfo.DeptID.ToString();
        DataRow   dtDeptID = SubStorageDBHelper.GetSubDeptFromDeptID(UserInfo.DeptID.ToString());
        if (dtDeptID != null)
        {
            deptID = dtDeptID["ID"].ToString();
        }
        DataTable dtDetail = SubStorageBus.Details(intID, deptID);
        dtDetail.Columns.Add("SortNo", typeof(string));
        for (int i = 0; i < dtDetail.Rows.Count; i++)
        {
            dtDetail.Rows[i]["SortNo"] = i + 1;
        }
        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 = GetDefaultFields(aBase);
            /*基本信息字段+扩展信息字段*/
            if (countExt > 0)
            {
                for (int i = 0; i < countExt; i++)
                {
                    strBaseFields += "|ExtField" + (i + 1);
                }
            }
            strDetailFields = GetDefaultFields(aDetail);
        }

        #region 主表信息
        if (!string.IsNullOrEmpty(strBaseFields))
        {
            tableBase.InnerHtml = WritePrintPageTable("分店期初库存", strBaseFields, strDetailFields, aBase, aDetail, dt, dtDetail, true);
        }
        #endregion

        #region 明细信息
        if (!string.IsNullOrEmpty(strDetailFields))
        {
            tableDetail.InnerHtml = WritePrintPageTable("分店期初库存", strBaseFields, strDetailFields, aBase, aDetail, dt, dtDetail, false);
        }
        #endregion
    }