/// <summary> /// 同批相同计划 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnShowSameLot_OnClick(object sender, EventArgs e) { btnShowSameLot.Visible = false; string marid = ((Label)SmartGridView1.Rows[0].FindControl("lblMarid")).Text.Trim(); string pid = ((Label)SmartGridView1.Rows[0].FindControl("lblLotNum")).Text.Trim(); string sql = "select * from View_TM_OUTSOURCELIST where OSL_ENGID='" + ViewState["engid"].ToString() + "' and OSL_MARID='" + marid + "' and OSL_OUTSOURCENO='" + pid + "' and OSL_NEWXUHAO!='" + ViewState["xuhao"].ToString() + "'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); SmartGridView3.DataSource = dt; SmartGridView3.DataBind(); if (SmartGridView3.Rows.Count > 0) { NoDataPanel3.Visible = false; } else { NoDataPanel3.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["retu"] = Request.UrlReferrer.ToString(); String unitID = Request["unitID"]; if (unitID == null) { unitID = Session[SessionMgm.UnitID].ToString(); String guideID = Request["guideID"]; auditedSocialProjects.SelectParameters["unitID"].DefaultValue = unitID; SqlDataSource1.SelectParameters["unitID"].DefaultValue = unitID; DataClassesDataContext dc = new DataClassesDataContext(); AssignProject ap = dc.AssignProject.SingleOrDefault(_ap => _ap.F_projectID.Equals(guideID) && _ap.F_unitID.Equals(unitID)); if (ap != null) { decimal amount = ap.F_amount.Value; int sciB = ap.F_sciB.Value; int sciImp = ap.F_sciImp.Value; int sciInd = ap.F_sciIndustry.Value; int sciNor = ap.F_sciNormal.Value; int socImp = ap.F_socialImpA.Value; int socNor = ap.F_socialNorA.Value; int socProxy = ap.F_socialProxy.Value; int socB = ap.F_socialB.Value; labAmount.Text = amount.ToString(); labSciB.Text = sciB.ToString(); labSciImp.Text = sciImp.ToString(); labSciInd.Text = sciInd.ToString(); labSciNor.Text = sciNor.ToString(); labSocB.Text = socB.ToString(); labSocImp.Text = socImp.ToString(); labSocNor.Text = socNor.ToString(); labSocProxy.Text = socProxy.ToString(); int usedsciImp = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("重点") && unitID.Equals(_sp.F_unitID)); int usedsciInd = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("产学研") && unitID.Equals(_sp.F_unitID)); int usedsciNor = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("一般") && unitID.Equals(_sp.F_unitID)); int usedsciB = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("B类") && unitID.Equals(_sp.F_unitID)); int usedsocImp = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("A类重点项目") && unitID.Equals(_sp.F_unitID)); int usedsocNor = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("一般项目") && unitID.Equals(_sp.F_unitID)); int usedsocB = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("B类项目") && unitID.Equals(_sp.F_unitID)); int usedsocProxy = dc.ViewAuditedBySchool.Count(_sp => _sp.F_guideProjectID.Equals(guideID) && _sp.F_type.Equals("委托项目") && unitID.Equals(_sp.F_unitID)); decimal?sumOfSci = (from m in dc.ViewAuditedBySchool where m.F_guideProjectID.Equals(guideID) && unitID.Equals(m.F_unitID) && "科技项目".Equals(m.F_projectType) select m.F_fund).Sum(); decimal value1 = 0; if (sumOfSci != null) { value1 = sumOfSci.Value; } decimal?sumOfSocial = (from m in dc.ViewAuditedBySchool where m.F_guideProjectID.Equals(guideID) && unitID.Equals(m.F_unitID) && "社科项目".Equals(m.F_projectType) select m.F_fund).Sum(); decimal value2 = 0; if (sumOfSocial != null) { value2 = sumOfSocial.Value; } decimal usedamount = value1 + value2; labUseAmount.Text = usedamount.ToString(); labUseSciB.Text = usedsciB.ToString(); labUseSciImp.Text = usedsciImp.ToString(); labUseSciInd.Text = usedsciInd.ToString(); labUseSciNor.Text = usedsciNor.ToString(); labUseSocB.Text = usedsocB.ToString(); labUseSocImp.Text = usedsocImp.ToString(); labUseSocNor.Text = usedsocNor.ToString(); labUseSocProxy.Text = usedsocProxy.ToString(); labRemAmount.Text = (amount - usedamount).ToString(); labRemB.Text = (socB - usedsocB).ToString(); labRemNor.Text = (socNor - usedsocNor).ToString(); labRemProxy.Text = (socProxy - usedsocProxy).ToString(); labRemSocImp.Text = (socImp - usedsocImp).ToString(); labRemSciB.Text = (sciB - usedsciB).ToString(); labRemSciImp.Text = (sciImp - usedsciImp).ToString(); labRemSciInd.Text = (sciInd - usedsciInd).ToString(); labRemSciNor.Text = (sciNor - usedsciNor).ToString(); } } gvSocial.DataBind(); SmartGridView3.DataBind(); } }