Exemple #1
0
 protected void imgBtnDelC_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         bool isChecked = false;
         foreach (GridViewRow row in this.grdLog.Rows)
         {
             CheckBox check = (CheckBox)row.Cells[0].FindControl("chk_Delete");
             if (check.Checked)
             {
                 isChecked = true;
                 string docId = row.Cells[1].Text.Trim();
                 DataOperClass.DeleteSingerDoc(docId);
             }
         }
         if (isChecked == false)
         {
             PrintfError("没有选择要删除的日志信息!");
             return;
         }
         this.PrintfError("删除成功!");
         SetPageCountView();
         BindGridView();
     }
     catch
     {
         this.PrintfError("数据访问错误,请重试!");
         return;
     }
 }
Exemple #2
0
    protected void btnHandLoad_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            int      rowIndex  = Convert.ToInt32(this.hidRowIndex.Value);
            string[] fileNames = this.grdLog.Rows[rowIndex].Cells[6].Text.Split('\\');
            string   fileName  = fileNames[fileNames.Length - 1];
            string   path      = "../../Logerror/" + DateTime.Now.ToShortDateString();;
            if (!Directory.Exists(Server.MapPath(path)))
            {
                Directory.CreateDirectory(Server.MapPath(path));
            }
            XmlDocument doc = new XmlDocument();
            doc.Load("http://" + Common.INTERFACESERVER + "/acctruewms/" + fileName);
            doc.Save(Server.MapPath(path) + "/" + fileName);//保存本地文件

            MSXML2.XMLHTTP xmlhttp = new MSXML2.XMLHTTPClass();
            xmlhttp.open("post", Common.NCWERBSERVER, false, "", "");
            DOMDocument sDoc = new DOMDocument();
            sDoc.loadXML(doc.InnerXml);
            xmlhttp.send(sDoc);
            if (xmlhttp.status == 200)
            {
                string comResult = "";
                string comDes    = "";
                doc.LoadXml(xmlhttp.responseText);
                XmlElement rootRoot = doc.DocumentElement;
                string     rootTag  = rootRoot.GetAttribute("roottag");
                XmlNode    node     = rootRoot.SelectSingleNode(rootTag + "/resultcode");
                if (node != null)
                {
                    comResult = node.InnerText.Trim();
                }
                XmlNode nodeDes = rootRoot.SelectSingleNode(rootTag + "/resultdescription");
                if (nodeDes != null)
                {
                    comDes = nodeDes.InnerText.Trim();
                }
                HtmlInputHidden hidCom  = (HtmlInputHidden)this.grdLog.Rows[rowIndex].Cells[0].FindControl("hidComid");
                string          comID   = hidCom.Value;
                int             uResult = DataOperClass.ReLoadLog(comResult, comDes, comID);
                if (uResult == -1)
                {
                    PrintfError("数据访问失败!");
                    return;
                }
                BindGridView();
                PrintfError("手工加载成功");
            }
        }
        catch
        {
            this.PrintfError("数据访问错误!");
            return;
        }
    }
Exemple #3
0
    protected void btnResend_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            int   rowIndex = Convert.ToInt32(this.hidRowIndex.Value.Trim());
            Label lblDoc   = (Label)this.grdLog.Rows[rowIndex].Cells[0].FindControl("lblDocID");
            if (!this.CUSER.USERFUNCTION.RESENDBILL)
            {
                this.PrintfError("对不起,您没有重发单据的权限!");
                return;
            }
            if (string.IsNullOrEmpty(this.hidRowIndex.Value))
            {
                this.PrintfError("没有选择的单据!");
                return;
            }

            string docType = this.grdLog.Rows[rowIndex].Cells[3].Text.Trim();
            if (docType == "4R")
            {
                this.PrintfError("盘点单据的重发需在【盘点数据上传】模块处理!");
                return;
            }
            if (docType == "A4")
            {
                string  strWGD = lblDoc.Text.Trim();
                DataSet ds     = WGDQuery.GetWGDInfo(strWGD);
                if (ds == null || Convert.ToInt32(ds.Tables[0].Rows[0]["wcbz"]) != 3)
                {
                    this.PrintfError("该完工单尚未完成入库,不能重发");
                    return;
                }
            }

            string docID  = lblDoc.Text.Trim();
            string ck     = this.grdLog.Rows[rowIndex].Cells[2].Text.Split('|')[0].Trim();
            int    result = DataOperClass.ResendData(docID, docType, this.CUSER.UserID, ck);
            if (result == -1)
            {
                this.PrintfError("重发失败,请重试!");
                return;
            }
            this.PrintfError("单据重发完毕!");
        }
        catch
        {
            this.PrintfError("数据访问错误!");
            return;
        }
    }
Exemple #4
0
 protected void imgBtnDelA_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string sql = GetWhere();
         DataOperClass.DeleteQueryDoc(sql);
         this.PrintfError("删除成功!");
         SetPageCountView();
         BindGridView();
     }
     catch
     {
         this.PrintfError("数据访问错误!");
         return;
     }
 }