Beispiel #1
0
 public Aisino.Fwkp.Fpkj.Model.DKFP DictionaryToModel(out Aisino.Fwkp.Fpkj.Model.DKFP model, Dictionary <string, object> dit)
 {
     model = new Aisino.Fwkp.Fpkj.Model.DKFP();
     try
     {
         model.FPDM = Convert.ToString(this.dict["FPDM"]);
         int result = 0;
         int.TryParse(this.dict["FPHM"].ToString().Trim(), out result);
         model.FPHM = result;
         model.RZLX = Convert.ToString(this.dict["RZLX"]);
         string s = this.dict["KPRQ"].ToString().Trim();
         model.KPRQ  = DateTime.Parse(s);
         model.XFSBH = Convert.ToString(this.dict["XFSBH"]);
         string str2 = this.dict["JE"].ToString().Trim();
         model.JE = double.Parse(str2);
         string str3 = this.dict["SE"].ToString().Trim();
         model.SE = double.Parse(str3);
         string str4 = this.dict["RZRQ"].ToString().Trim();
         model.RZRQ = DateTime.Parse(str4);
         model.FPLX = Convert.ToString(this.dict["FPLX"]);
         return(model);
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
         return(null);
     }
 }
Beispiel #2
0
        public List <Aisino.Fwkp.Fpkj.Model.DKFP> SelectDkpf_DKFPDaoChu(Dictionary <string, object> condition)
        {
            List <Aisino.Fwkp.Fpkj.Model.DKFP> list = new List <Aisino.Fwkp.Fpkj.Model.DKFP>();

            list.Clear();
            string    str   = "aisino.fwkp.fpkj.SelectDKFPDaoChu";
            ArrayList list2 = this.baseDao.querySQL(str, condition);

            if ((list2 != null) && (list2.Count > 0))
            {
                int num   = 0;
                int count = list2.Count;
                for (num = 0; num < count; num++)
                {
                    Dictionary <string, object> dict = list2[num] as Dictionary <string, object>;
                    Aisino.Fwkp.Fpkj.Model.DKFP item = this.GetDkfp(dict);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            list2 = null;
            return(list);
        }
Beispiel #3
0
 public bool Add(Aisino.Fwkp.Fpkj.Model.DKFP model)
 {
     try
     {
         this.dict.Clear();
         this.dict.Add("RZLX", model.RZLX);
         this.dict.Add("FPLX", model.FPLX);
         this.dict.Add("FPDM", model.FPDM);
         this.dict.Add("FPHM", model.FPHM);
         this.dict.Add("KPRQ", model.KPRQ);
         this.dict.Add("XFSBH", model.XFSBH);
         this.dict.Add("JE", model.JE);
         this.dict.Add("SE", model.SE);
         this.dict.Add("RZRQ", model.RZRQ);
         this.dict.Add("JSPH", model.JSPH);
         this.dict.Add("KPJH", model.KPJH);
         this.dict.Add("XZSJ", model.XZSJ);
         if (this.baseDao.未确认DAO方法2_疑似updateSQL("aisino.fwkp.fpkj.AddDKFP", this.dict) <= 0)
         {
             return(false);
         }
         return(true);
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
         return(false);
     }
 }
Beispiel #4
0
 public Aisino.Fwkp.Fpkj.Model.DKFP GetModel(string FPDM, int FPHM)
 {
     try
     {
         this.dict.Clear();
         this.dict.Add("FPDM", FPDM);
         this.dict.Add("FPHM", FPHM);
         ArrayList list = this.baseDao.querySQL("aisino.fwkp.fpkj.SelectDKFP", this.dict);
         Aisino.Fwkp.Fpkj.Model.DKFP model = new Aisino.Fwkp.Fpkj.Model.DKFP();
         if (list.Count > 0)
         {
             this.dict.Clear();
             this.dict = list[0] as Dictionary <string, object>;
             this.DictionaryToModel(out model, this.dict);
             list = null;
             return(model);
         }
         list = null;
         return(null);
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
         return(null);
     }
 }
        private void BtnDownload_Click(object sender, EventArgs e)
        {
            string str = string.Empty;
            string xml = string.Empty;

            try
            {
                base.DialogResult = DialogResult.OK;
                int num = 0;
                str = this.GenDownloadXML();
                if (str == null)
                {
                    MessageBoxHelper.Show("请正确输入抵扣发票下载条件!");
                    base.DialogResult = DialogResult.Retry;
                }
                else
                {
                    this.progressBar.SetTip("正在连接服务器", "请等待任务完成", "发票下载中");
                    this.progressBar.fpxf_progressBar.Value = 0x3e8;
                    this.progressBar.Visible = true;
                    this.progressBar.Refresh();
                    this.progressBar.Show();
                    this.ProcessStartThread(this.step);
                    this.progressBar.Refresh();
                    HttpsSender.SendMsg("0012", str, out xml);
                    this.progressBar.SetTip("正在下载发票", "请等待任务完成", "发票下载中");
                    this.ProcessStartThread(this.step * 3);
                    this.progressBar.Refresh();
                    switch (xml)
                    {
                    case null:
                    case "":
                        xml = "受理服务器没有返回数据。";
                        break;
                    }
                    List <Aisino.Fwkp.Fpkj.Model.DKFP> dkfps = new List <Aisino.Fwkp.Fpkj.Model.DKFP>();
                    XmlDocument document  = new XmlDocument();
                    string      innerText = "";
                    if (xml != "")
                    {
                        document.LoadXml(xml);
                        System.Xml.XmlNode node2 = document.SelectSingleNode("/FPXT").SelectSingleNode("OUTPUT");
                        if (node2 != null)
                        {
                            System.Xml.XmlNode node3 = node2.SelectSingleNode("CODE");
                            if (node3 != null)
                            {
                                innerText = node3.InnerText;
                                if (node3.InnerText == "0000")
                                {
                                    System.Xml.XmlNode node4 = node2.SelectSingleNode("DATA");
                                    if (node4 != null)
                                    {
                                        System.Xml.XmlNode node5 = node4.SelectSingleNode("RZFP");
                                        if (node5 != null)
                                        {
                                            XmlNodeList list2 = node5.SelectNodes("FPXX");
                                            if (list2 != null)
                                            {
                                                foreach (System.Xml.XmlNode node6 in list2)
                                                {
                                                    Aisino.Fwkp.Fpkj.Model.DKFP item = new Aisino.Fwkp.Fpkj.Model.DKFP {
                                                        FPDM  = node6.SelectSingleNode("FPDM").InnerText.Trim(),
                                                        FPHM  = Convert.ToInt32(node6.SelectSingleNode("FPHM").InnerText.Trim()),
                                                        FPLX  = node6.SelectSingleNode("FPLX").InnerText.Trim(),
                                                        RZLX  = node6.SelectSingleNode("RZLX").InnerText.Trim(),
                                                        KPRQ  = Convert.ToDateTime(this.ConvertDateFormat(node6.SelectSingleNode("KPRQ").InnerText.Trim())),
                                                        RZRQ  = Convert.ToDateTime(this.ConvertDateFormat(node6.SelectSingleNode("RZRQ").InnerText.Trim())),
                                                        XFSBH = node6.SelectSingleNode("XFSBH").InnerText.Trim(),
                                                        JE    = Convert.ToDouble(node6.SelectSingleNode("JE").InnerText.Trim()),
                                                        SE    = Convert.ToDouble(node6.SelectSingleNode("SE").InnerText.Trim()),
                                                        JSPH  = "",
                                                        KPJH  = "",
                                                        XZSJ  = DateTime.Now
                                                    };
                                                    dkfps.Add(item);
                                                    num++;
                                                }
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    System.Xml.XmlNode node7 = node2.SelectSingleNode("MESS");
                                    if ((node7.InnerText == null) || (node7.InnerText == ""))
                                    {
                                        node7.InnerText = "下载服务器错误";
                                    }
                                    MessageManager.ShowMsgBox("DKFPXZ-0003", "提示", new string[] { node7.InnerText });
                                }
                            }
                        }
                        if (num > 0)
                        {
                            this.progressBar.SetTip("正在保存发票", "请等待任务完成", "发票下载中");
                            this.ProcessStartThread(this.step * 4);
                            this.progressBar.Refresh();
                            this.progressBar.Visible = false;
                            int num2 = this.SaveDkfpToDb(dkfps);
                            if (num == num2)
                            {
                                MessageManager.ShowMsgBox("DKFPXZ-0004", "提示", new string[] { num2.ToString() });
                            }
                            else
                            {
                                string[] strArray3 = new string[] { num.ToString(), num2.ToString(), (num - num2).ToString() };
                                MessageManager.ShowMsgBox("DKFPXZ-0005", "错误", strArray3);
                            }
                            this.ProcessStartThread(this.step * 4);
                            this.progressBar.Refresh();
                            this.progressBar.Visible = false;
                        }
                        else if ((num == 0) && (innerText == "0000"))
                        {
                            MessageManager.ShowMsgBox("DKFPXZ-0006");
                            this.progressBar.Visible = false;
                            this.Refresh();
                        }
                    }
                    else
                    {
                        MessageManager.ShowMsgBox("DKFPXZ-0003", "提示", new string[] { xml });
                        this.ProcessStartThread(this.step * 4);
                        this.progressBar.Refresh();
                        this.progressBar.Visible = false;
                    }
                    this.Refresh();
                }
            }
            catch (Exception exception)
            {
                MessageManager.ShowMsgBox("DKFPXZ-0003", "提示", new string[] { xml });
                this.loger.Error(exception.Message);
                this.ProcessStartThread(this.step * 4);
                this.progressBar.Visible = false;
                this.Refresh();
            }
            finally
            {
                this.progressBar.Visible = false;
                this.Refresh();
            }
        }