コード例 #1
0
ファイル: OrderCompareSpd.aspx.cs プロジェクト: cjllove/ERP
        protected void btnSearch2_Click(object sender, EventArgs e)
        {
            if (lstLRRQ11.SelectedDate == null || lstLRRQ22.SelectedDate == null)
            {
                Alert.Show("请输入条件【录入日期】!");
                return;
            }
            else if (lstLRRQ11.SelectedDate > lstLRRQ22.SelectedDate)
            {
                Alert.Show("开始日期大于结束日期,请重新输入!");
                return;
            }

            DateTime lrrq1Value = (DateTime)lstLRRQ11.SelectedDate;
            DateTime lrrq2Value = (DateTime)lstLRRQ22.SelectedDate;

            string custId = DbHelperOra.GetSingle("select value from sys_para where code='USERCODE'").ToString();
            string dno    = txtBillNo2.Text.Trim();

            string strBeginDate = lrrq1Value.ToString("yyyy-MM-dd");
            string strEndDate   = lrrq2Value.ToString("yyyy-MM-dd");

            String[] paramArray = { strBeginDate, strEndDate, dno, custId };

            //查询eas上调拨入库单
            string result = ApiClientService.QueryEASBill("DRK", paramArray);

            if (String.IsNullOrWhiteSpace(result) || "-1".Equals(result))
            {
                Alert.Show("与数据中心通讯失败,请稍后再试!", "消息提示", MessageBoxIcon.Warning);
                return;
            }

            string strBillNos = "";
            JArray jaResult   = JArray.Parse(result);//多单据数组

            foreach (JToken jt in jaResult)
            {
                JObject jResult = (JObject)jt;//单单据对象
                if ("success".Equals(jResult.Value <String>("result")))
                {
                    JArray ja = jResult.Value <JArray>("data");
                    if (ja.Count > 0)
                    {
                        strBillNos = strBillNos +   "'" + saveRKDocCom(ja) + "',";//把下传的单据保存到用于比较的临时表DAT_RK_DOC_COMPARE,DAT_RK_COM_COMPARE
                    }
                }
            }
            if (!String.IsNullOrWhiteSpace(strBillNos))
            {
                strBillNos = strBillNos.TrimEnd(',');
                string strSql = @"SELECT SEQNO,DDBH,NULL DHRQ,DHRQ DHRQ_EAS,NULL SUBNUM,SUBNUM SUBNUM_EAS,NULL SUBSUM,SUBSUM SUBSUM_EAS,(select VALUE from sys_para where code='USERCODE') CUSTID
                                from DAT_RK_DOC_COMPARE  where BILLNO IN (" + strBillNos + ") order by seqno";
                GridList2.DataSource = DbHelperOra.Query(strSql).Tables[0];
            }
            else
            {
                Alert.Show("没有查询到订单!", "消息提示", MessageBoxIcon.Warning);
                return;
            }

            GridList2.DataBind();
            GridDetail2.DataSource = null;
            GridDetail2.DataBind();
        }
コード例 #2
0
ファイル: OrderCompareSpd.aspx.cs プロジェクト: cjllove/ERP
        protected void GridList2_RowDoubleClick(object sender, FineUIPro.GridRowClickEventArgs e)
        {
            string strBillNo = GridList2.Rows[e.RowIndex].Values[1].ToString();

            ToolbarSeqno.Text = strBillNo;
//            string strSql = @"SELECT A.SEQNO,A.ROWNO,B.GDSEQ,A.GDSEQ GDSEQ_EAS,B.UNIT,A.UNIT UNIT_EAS,B.GDSPEC,A.GDSPEC GDSPEC_EAS,B.SSSL,A.SSSL SSSL_EAS
//                               ,B.PH,A.PH PH_EAS,B.HSJJ,A.HSJJ HSJJ_EAS
//                               FROM DAT_RK_COM_COMPARE A LEFT JOIN DAT_RK_COM B ON A.SEQNO=B.SEQNO AND A.ROWNO=B.ROWNO
//                               WHERE A.SEQNO='" + strBillNo + "'";
            string strSql = @"select null MEMO,c.* from
                            (select a.*,B.GDSEQ GDSEQ_EAS,B.SSSL SSSL_EAS,B.PH PH_EAS from
                            (select SEQNO,GDSEQ,GDNAME,F_GETUNITNAME(UNIT) UNIT,GDSPEC,SSSL,PH from dat_rk_com 
                            where SEQNO='{0}' ) a
                            left join (select SEQNO,GDSEQ,SSSL,PH from dat_rk_com_compare where SEQNO='{0}' ) b
                            on a.gdseq=b.gdseq and a.ph=b.ph
                            union
                            select a.seqno,null gdseq,a.gdname,a.unit,a.gdspec,null sssl,null ph,a.gdseq gdseq_eas,a.sssl sssl_eas,a.ph ph_eas from
                            (select SEQNO,GDSEQ,GDNAME,F_GETUNITNAME(UNIT) UNIT,GDSPEC,SSSL,PH from dat_rk_com_compare 
                            where SEQNO='{0}' ) a
                            where  not EXISTS ( select * from (select SEQNO,ROWNO,GDSEQ,SSSL,PH from dat_rk_com where SEQNO='{0}' ) b where a.gdseq=b.gdseq and a.ph=b.ph)) c
                            order by c.seqno asc";

            strSql = string.Format(strSql, strBillNo);
            DataTable dt = DbHelperOra.Query(strSql).Tables[0];

            string GreenRowsList  = "";
            string RedRowsList    = "";
            string YellowRowsList = "";

            foreach (DataRow dr in dt.Rows)
            {
                string strGDSEQ = "";
                if (dr["GDSEQ"] != null && !"".Equals(dr["GDSEQ"].ToString()))
                {
                    strGDSEQ = dr["GDSEQ"].ToString();
                }
                else
                {
                    //如果GDSEQ是NULL或者空值,说明DAT_RK_COM中没有该单据,标识黄色
                    YellowRowsList += dt.Rows.IndexOf(dr).ToString() + ",";
                    dr["MEMO"]      = "ERP没有EAS有";
                    continue;
                }
                string strGDSEQ_EAS = dr["GDSEQ_EAS"].ToString();
                if (dr["GDSEQ_EAS"] != null && !"".Equals(dr["GDSEQ_EAS"].ToString()))
                {
                    strGDSEQ_EAS = dr["GDSEQ_EAS"].ToString();
                }
                else
                {
                    //如果GDSEQ_EAS是NULL或者空值,说明DAT_RK_COM_COMPARE中没有该单据,标识白色
                    dr["MEMO"] = "ERP有EAS没有";
                    continue;
                }
                //string strUNIT = dr["UNIT"].ToString();
                //string strUNIT_EAS = dr["UNIT_EAS"].ToString();
                //string strGDSPEC = dr["GDSPEC"].ToString();
                //string strGDSPEC_EAS = dr["GDSPEC_EAS"].ToString();
                Decimal SSSL     = Convert.ToDecimal(dr["SSSL"]);
                Decimal SSSL_EAS = Convert.ToDecimal(dr["SSSL_EAS"]);
                //Decimal HSJJ = Convert.ToDecimal(dr["HSJJ"]);
                //Decimal HSJJ_EAS = Convert.ToDecimal(dr["HSJJ_EAS"]);
                if (strGDSEQ_EAS.Equals(strGDSEQ) && SSSL == SSSL_EAS)
                {
                    GreenRowsList += dt.Rows.IndexOf(dr).ToString() + ",";
                    dr["MEMO"]     = "完全匹配";
                }
                else
                {
                    RedRowsList += dt.Rows.IndexOf(dr).ToString() + ",";
                    dr["MEMO"]   = "订单数量不匹配";
                }
            }
            GridDetail2.DataSource = dt;
            GridDetail2.DataBind();
            PageContext.RegisterStartupScript("onGridDataLoad2('" + RedRowsList + "','" + GreenRowsList + "','" + YellowRowsList + "','" + GridDetail2.ClientID + "');");
        }