Beispiel #1
0
        private static void mailDetail(int usrId, string strProjetTag, string payNum, Xm_db xmDataCont)
        {
            //var usr_autority =
            //from usr in xmDataCont.Tbl_usr
            //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
            //where (auth.UsrId == usrId ||
            //      auth.AuthorityId == 25) &&
            //        auth.UsrAuEnd > DateTime.Now
            //select usr;

            //int flag = 0x2000;
            var usr_autority =
                from usr in xmDataCont.Tbl_usr
                //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                where (usr.UsrId == usrId ||
                       ((usr.TotleAuthority & (UInt32)AuthAttributes.pay_receiptExamine) != 0)) &&
                usr.EndTime > DateTime.Now
                //where (usr.UsrId == usrId ||
                //      usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.pay_receiptExamine)) &&
                //      usr.EndTime > DateTime.Now
                select usr;

            foreach (var usr in usr_autority)
            {
                BeckSendMail.getMM().NewMail(usr.UsrEmail, "mis系统票务通知", strProjetTag + "的付款申请已完成" + payNum + ",请尽快完成后续工作");
            }
        }
Beispiel #2
0
        private void examine(string okOrNot)
        {
            if (inputCheck())
            {
                DataRow sessionDr = Session["seldSelfReceipt"] as DataRow;

                string strReceiptId      = sessionDr["receiptId"].ToString();
                string strReceiptComment = txtReceiptComment.Text.Trim();

                DataSet             dst = new DataSet();
                ReceiptApplyProcess rap = new ReceiptApplyProcess(dst);

                rap.SelfReceiptExamine(strReceiptId, okOrNot, strReceiptComment);

                Xm_db xmDataCont = Xm_db.GetInstance();

                int usrId   = int.Parse(sessionDr["usrId"].ToString());
                var usrInfo =
                    from usr in xmDataCont.Tbl_usr
                    where usr.UsrId == usrId &&
                    usr.EndTime > DateTime.Now
                    select usr;

                string projetTag = sessionDr["projectTag"].ToString();

                if (okOrNot.Equals(bool.TrueString))
                {
                    //int flag = 0x80;
                    var usr_autority =
                        from usr in xmDataCont.Tbl_usr
                        //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                        where (usr.TotleAuthority & (UInt32)AuthAttributes.pay_receiptOk) != 0 &&
                        usr.EndTime > DateTime.Now
                        select usr;
                    //where usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.pay_receiptOk) &&
                    //      usr.EndTime > DateTime.Now
                    //select usr;

                    foreach (var usr in usr_autority)
                    {
                        BeckSendMail.getMM().NewMail(usr.UsrEmail,
                                                     "mis系统票务通知",
                                                     "开票申请已通过审批,请尽快完成后续工作" + System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/paymentReceiptManager/receiptOk.aspx"));
                    }

                    BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail,
                                                 "mis系统票务通知",
                                                 projetTag + "的开票申请已通过审批,请尽快完成后续工作");
                }
                else
                {
                    BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail,
                                                 "mis系统票务通知",
                                                 projetTag + "的开票申请暂缓,请尽快完成后续工作");
                }
                Response.Redirect("~/Main/infoViewManager/receiptView.aspx");
            }
        }
        private static void sendMail(System.Nullable <int> mainContractId, IQueryable <View_mainContract_project_usr> ViewMainContract_project_usr)
        {
            var    emailDetail = ViewMainContract_project_usr.First(elm => elm.MainContractId == mainContractId);
            string usrEmail    = emailDetail.UsrEmail;
            string projectTag  = emailDetail.ProjectTag;
            string num         = emailDetail.SelfReceivingPercent.ToString("p");

            //DataTable dtSources = projectStepEdit.Distinct().ToDataTable();

            BeckSendMail.getMM().NewMail(usrEmail, "mis系统票务通知", projectTag + "项目总共收到客户付款额" + num);
        }
Beispiel #4
0
        private static void sendMail(System.Nullable <int> mainContractId, Xm_db xmDataCont, string num)
        {
            var emailDetail =
                from mainContract in xmDataCont.Tbl_mainContract
                join project in xmDataCont.Tbl_projectTagInfo on mainContract.ProjectTagId equals project.ProjectTagId
                join applyment_user in xmDataCont.Tbl_applyment_user on project.ProjectTagId equals applyment_user.ProjectTagId
                join user in xmDataCont.Tbl_usr on applyment_user.UsrId equals user.UsrId
                where mainContract.MainContractId == mainContractId
                select new { user.UsrEmail, project.ProjectTag };

            string usrEmail   = emailDetail.First().UsrEmail;
            string projectTag = emailDetail.First().ProjectTag;

            //string num = emailDetail.SelfReceivingPercent.ToString("p");
            //string num = ViewsSubContract_supplier.First(elm => elm.SubContractId == subContractId).ReceiptPercent.ToString("p");
            //DataTable dtSources = projectStepEdit.Distinct().ToDataTable();

            BeckSendMail.getMM().NewMail(usrEmail, "mis系统票务通知", projectTag + "项目总共收到客户付款额" + num);
        }
        private void mailDetail(string accessOrNot, DataRow sessionDr, Xm_db xmDataCont)
        {
            //var usr_autority =
            //from usr in xmDataCont.Tbl_usr
            //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
            //where auth.AuthorityId == 22 &&
            //      auth.UsrAuEnd > DateTime.Now
            //select usr;

            //int flag = 0x400;
            var usr_autority =
                from usr in xmDataCont.Tbl_usr
                //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                where (usr.TotleAuthority & (UInt32)AuthAttributes.productDetail) != 0 &&
                usr.EndTime > DateTime.Now
                select usr;
            //where usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.productDetail) &&
            //      usr.EndTime > DateTime.Now
            //select usr;

            string strProductTag  = sessionDr["productTag"].ToString();
            string strProductName = sessionDr["productName"].ToString();
            string strAccessOrNot = string.Empty;

            if (accessOrNot.Equals(bool.TrueString))
            {
                strAccessOrNot = "检验通过";
            }
            else
            {
                strAccessOrNot = "检验未通过";
            }

            foreach (var usr in usr_autority)
            {
                BeckSendMail.getMM().NewMail(usr.UsrEmail,
                                             "mis系统货物检验通知",
                                             "编号为" + strProductTag + "的" + strProductName + strAccessOrNot + ",等待您为其定义产品属性" +
                                             System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/stockInfoManager/productStockView/productStockDetail.aspx"));
            }
        }
Beispiel #6
0
        private void applyOk(string num, Xm_db xmDataCont)
        {
            //int flag = 0x2000;
            var usr_autority =
                from usr in xmDataCont.Tbl_usr
                //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                where (usr.TotleAuthority & (UInt32)AuthAttributes.pay_receiptExamine) != 0 &&
                usr.EndTime > DateTime.Now
                select usr;

            //where usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.pay_receiptExamine) &&
            //      usr.EndTime > DateTime.Now
            //select usr;

            foreach (var usr in usr_autority)
            {
                BeckSendMail.getMM().NewMail(usr.UsrEmail,
                                             "mis系统票务审批通知",
                                             "申请付款" + num + System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/infoViewManager/paymentInfo/paymentView.aspx"));
            }

            Response.Redirect("~/Main/paymentReceiptManager/paymentApply.aspx");
        }
Beispiel #7
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            GridViewRow gvr = selfReceiptGV.SelectedRow;

            int index = gvr.DataItemIndex;

            DataTable dt = Session["dtSources"] as DataTable;

            string strReceiptId = dt.Rows[index]["receiptId"].ToString();
            int    usrId        = int.Parse(dt.Rows[index]["usrId"].ToString());
            string projetTag    = dt.Rows[index]["projectTag"].ToString();
            //string receiptNum = dt.Rows[index]["receiptPercent"].ToString();
            string strReceiptPercent = dt.Rows[index]["receiptPercent"].ToString();
            string strMainContractId = dt.Rows[index]["mainContractId"].ToString();
            string strProjetTagId    = dt.Rows[index]["projectTagId"].ToString();

            //string strFilter =
            //        " receiptId = " + "'" + strReceiptId + "'";
            //dt.DefaultView.RowFilter = strFilter;

            //DataTable doneTable = dt.DefaultView.ToTable("addTable");
            //dt.Clear();

            //ReceiptApplyProcess rap = Session["ReceiptApplyProcess"] as ReceiptApplyProcess;

            //rap.MyDst.Tables.Add(doneTable);
            //rap.SelfReceiptDone();

            Xm_db xmDataCont = Xm_db.GetInstance();

            int    receiptId      = int.Parse(strReceiptId);
            float  receiptPercent = float.Parse(strReceiptPercent);
            int    mainContractId = int.Parse(strMainContractId);
            int    projectTagId   = int.Parse(strProjetTagId);
            string receiptNum     = receiptPercent.ToString("p");

            xmDataCont.SelfReceipt_done(receiptId, receiptPercent, mainContractId, projectTagId);


            //var usr_autority =
            //    from usr in xmDataCont.Tbl_usr
            //    join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
            //    where (auth.UsrId == usrId ||
            //          auth.AuthorityId == 25) &&
            //            auth.UsrAuEnd > DateTime.Now
            //    select usr;

            //int flag = 0x2000;
            var usr_autority =
                from usr in xmDataCont.Tbl_usr
                //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                where (usr.UsrId == usrId ||
                       ((usr.TotleAuthority & (UInt32)AuthAttributes.pay_receiptExamine) != 0)) &&
                usr.EndTime > DateTime.Now
                select usr;

            //where (usr.UsrId == usrId ||
            //      usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.pay_receiptExamine)) &&
            //      usr.EndTime > DateTime.Now
            //select usr;

            foreach (var usr in usr_autority)
            {
                BeckSendMail.getMM().NewMail(usr.UsrEmail, "mis系统票务通知", projetTag + "的开票申请已完成" + receiptNum + ",请尽快完成后续工作");
            }

            var viewMainReceipt =
                from mainReceipt in xmDataCont.View_mainReceipt
                where mainReceipt.EndTime > DateTime.Now &&
                mainReceipt.IsAccept.Equals(bool.TrueString) &&
                mainReceipt.DoneTime > DateTime.Now
                select mainReceipt;

            DataTable taskTable = viewMainReceipt.ToDataTable();
            //rap.RealSelfReceiptView();
            //DataTable taskTable = rap.MyDst.Tables["view_mainReceipt"].DefaultView.ToTable();

            //string end = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff");
            //strFilter =
            //    " isAccept = " + "'" + bool.TrueString + "'" +
            //    " and doneTime > " + "'" + end + "'";

            string strFilter = string.Empty;

            dt_modify(taskTable, strFilter);

            Session["dtSources"] = taskTable.DefaultView.ToTable();

            selfReceiptGV.SelectedIndex       = -1;
            selfReceiptGV.Enabled             = true;
            selfReceiptGV.Columns[12].Visible = true;

            selfReceiptGV.DataSource = Session["dtSources"];
            selfReceiptGV.DataBind();

            btnOk.Visible = false;
            btnNo.Visible = false;
        }
Beispiel #8
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            if (inputCheck())
            {
                string strProductId  = ddlProduct.SelectedValue;
                string strProductTag = txtProductTag.Text.Trim();
                string strSupplierId = ddlSupplier.SelectedValue;
                string strUsrId      = ddlEngineer.SelectedValue;

                DataRow productInRow = null;

                DataColumn colProductId  = new DataColumn("productId", System.Type.GetType("System.String"));
                DataColumn colProductTag = new DataColumn("productTag", System.Type.GetType("System.String"));
                DataColumn colSupplierId = new DataColumn("supplierId", System.Type.GetType("System.String"));
                DataColumn colUsrId      = new DataColumn("usrId", System.Type.GetType("System.String"));

                DataTable productInTable = new DataTable("addTable");

                productInTable.Columns.Add(colProductId);
                productInTable.Columns.Add(colProductTag);
                productInTable.Columns.Add(colSupplierId);
                productInTable.Columns.Add(colUsrId);

                productInRow = productInTable.NewRow();
                productInRow["productId"]  = strProductId;
                productInRow["productTag"] = strProductTag;
                productInRow["supplierId"] = strSupplierId;
                productInRow["usrId"]      = strUsrId;
                productInTable.Rows.Add(productInRow);

                #region dataset
                DataSet dataSet = new DataSet();

                dataSet.Tables.Add(productInTable);
                #endregion

                ProductStockProcess psp = new ProductStockProcess(dataSet);

                //psp.DoCheckProductStock();
                //int rowRtn = psp.IntRtn;

                string error = psp.Add_includeError();

                if (string.IsNullOrEmpty(error))
                {
                    Xm_db xmDataCont = Xm_db.GetInstance();

                    int usrId   = int.Parse(strUsrId);
                    var usrInfo =
                        from usr in xmDataCont.Tbl_usr
                        where usr.UsrId == usrId &&
                        usr.EndTime > DateTime.Now
                        select usr;

                    string strProductName = ddlProduct.SelectedItem.Text;

                    BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail,
                                                 "mis系统入库通知",
                                                 "编号为" + strProductTag + "的" + strProductName + "等待您的校验" + System.Environment.NewLine
                                                 + Request.Url.toNewUrlForMail("/Main/stockInfoManager/productCheckView.aspx"));

                    Response.Redirect("~/Main/DefaultMainSite.aspx");
                }
                else
                {
                    this.txtProductTag.Text = error;
                }
            }
        }
        protected void outView_Click(object sender, EventArgs e)
        {
            GridViewRow gvr = (sender as LinkButton).Parent.Parent as GridViewRow;

            int index = gvr.DataItemIndex;

            DataTable dt = Session["view_project_need_product"] as DataTable;

            string projectTagId             = dt.Rows[index]["projectTagId"].ToString();
            string productPurposeRelationId = dt.Rows[index]["productPurposeRelationId"].ToString();
            string subContractProductId     = dt.Rows[index]["subContractProductId"].ToString();
            string productStockId           = dt.Rows[index]["productStockId"].ToString();
            string strProductName           = dt.Rows[index]["productName"].ToString();
            string strProductTag            = dt.Rows[index]["productTag"].ToString();

            DataSet ds = new DataSet();

            ds.Tables.Add(dt.DefaultView.ToTable("addTable"));
            SellProductProcess spp = new SellProductProcess(ds);

            spp.MyDst.Tables["addTable"].Clear();

            DataRow dr = spp.MyDst.Tables["addTable"].NewRow();

            dr["projectTagId"]             = projectTagId;
            dr["productPurposeRelationId"] = productPurposeRelationId;
            dr["subContractProductId"]     = subContractProductId;
            dr["productStockId"]           = productStockId;

            spp.MyDst.Tables["addTable"].Rows.Add(dr);
            dt.Clear();

            spp.Add();

            Xm_db xmDataCont = Xm_db.GetInstance();

            //var usr_autority =
            //    from usr in xmDataCont.Tbl_usr
            //    join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
            //    where auth.AuthorityId == 20 &&
            //          auth.UsrAuEnd > DateTime.Now
            //    select usr;

            //int flag = 0x100;
            var usr_autority =
                from usr in xmDataCont.Tbl_usr
                //join auth in xmDataCont.View_usr_autority on usr.UsrId equals auth.UsrId
                where (usr.TotleAuthority & (UInt32)AuthAttributes.stockManager) != 0 &&
                usr.EndTime > DateTime.Now
                select usr;

            //where usr.TotleAuthority.ToAuthAttr().HasOneFlag(AuthAttributes.stockManager) &&
            //      usr.EndTime > DateTime.Now
            //select usr;

            foreach (var usr in usr_autority)
            {
                BeckSendMail.getMM().NewMail(usr.UsrEmail,
                                             "mis系统出货准备通知",
                                             "编号为" + strProductTag + "的" + strProductName + ",等待您为其办理出货手续" +
                                             System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/stockInfoManager/productStockView/productStockDetail.aspx"));
            }

            lblNoOut.Visible   = false;
            btnNullRtn.Visible = false;

            sellProductGV.Visible = true;
            projectNeedGV.Visible = false;

            ProductPurposeRelationProcess pprpView = Session["ProductPurposeRelationProcess"] as ProductPurposeRelationProcess;

            pprpView.RealProductPurposeRelationView();

            DataTable productStockRelationTable = pprpView.MyDst.Tables["view_productStockRelation"].DefaultView.ToTable();

            string strFilter =
                " productPurpose = " + "'" + "forSell".ToString() + "'";

            productStockRelationTable.DefaultView.RowFilter = strFilter;
            Session["dtSources"] = productStockRelationTable.DefaultView.ToTable();

            sellProductGV.DataSource = Session["dtSources"];
            sellProductGV.DataBind();
        }