Ejemplo n.º 1
0
 private void aisinoDataGrid1_DataGridRowDbClickEvent(object sender, DataGridRowEventArgs e)
 {
     try
     {
         this.SelectBM   = e.CurrentRow.Cells["BM"].Value.ToString();
         this.SelectBMMC = e.CurrentRow.Cells["MC"].Value.ToString();
         DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
         if (this.Isxtsp)
         {
             bool isSPBMSel = BMType.BM_SP == this.GetBMType();
             if (manager.CanUseThisSPFLBM(this.SelectBM, isSPBMSel, true))
             {
                 base.DialogResult = DialogResult.OK;
                 base.Close();
                 base.Dispose();
             }
         }
         else
         {
             bool flag2 = BMType.BM_SP == this.GetBMType();
             if (manager.CanUseThisSPFLBM(this.SelectBM, flag2, false))
             {
                 base.DialogResult = DialogResult.OK;
                 base.Close();
                 base.Dispose();
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error(exception.ToString());
         ExceptionHandler.HandleError(exception);
     }
 }
Ejemplo n.º 2
0
 private void ComBoxSPFL_TextChanged(object sender, EventArgs e)
 {
     if (this.comBoxSPFL.Text.Trim() != "")
     {
         int selectionStart = this.comBoxSPFL.SelectionStart;
         this.comBoxSPFL.Text            = StringUtils.GetSubString(this.comBoxSPFL.Text, 0x13).Trim();
         this.comBoxSPFL.SelectionStart  = selectionStart;
         this.comboBoxYHZC.SelectedIndex = 1;
         object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { this.comBoxSPFL.Text.Trim() });
         if (((objArray != null) && ((objArray[0] as DataTable).Rows.Count > 0)) && ((objArray[0] as DataTable).Rows[0]["SLV"].ToString() != ""))
         {
             DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
             if (!manager.CanUseThisSPFLBM(this.comBoxSPFL.Text.Trim(), false, false))
             {
                 MessageBox.Show("查无此分类编码或此分类编码不可用,请重新输入!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 this.comBoxSPFL.Focus();
                 this.comboBoxYHZC.SelectedIndex = 1;
                 this.comboBoxYHZC.Enabled       = false;
                 return;
             }
         }
         this.AdjustComboBoxYHZC();
         this.AdjustComboBoxYHZCMC();
     }
 }
Ejemplo n.º 3
0
        private bool SimpleValidated()
        {
            bool flag = true;

            if (this.textBoxWaitMC.Text.Trim().Length == 0)
            {
                this.textBoxWaitMC.Focus();
                flag = false;
            }
            if (this.textBoxJM.Text.Trim().Trim().Length != 0)
            {
                string input = this.textBoxJM.Text.Trim();
                if ((input[0] < 'A') || (input[0] > 'Z'))
                {
                    this.textBoxJM.Focus();
                    flag = false;
                    MessageManager.ShowMsgBox("INP-235501");
                    return(flag);
                }
                string pattern = "^[A-Z0-9]+$";
                Regex  regex   = new Regex(pattern);
                if (!regex.IsMatch(input))
                {
                    this.textBoxJM.Focus();
                    flag = false;
                    MessageManager.ShowMsgBox("INP-235502");
                    return(flag);
                }
            }
            if (Flbm.IsYM())
            {
                DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
                if (!manager.CanUseThisSPFLBM(this.comBoxSPFL.Text.Trim(), false, false))
                {
                    MessageBox.Show("查无此分类编码或此分类编码不可用,请重新输入!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    this.comBoxSPFL.Focus();
                    this.SPFLMC.Text = "";
                    return(false);
                }
                this.SPFLMC.Text = manager.GetSPFLMCBYBM(this.comBoxSPFL.Text.Trim());
                if (("是" == this.comboBoxYHZC.SelectedItem.ToString()) && (this.comboBoxYHZCMC.Text == ""))
                {
                    MessageBox.Show("优惠类型不能为空,请重新选择!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    this.comboBoxYHZCMC.Focus();
                    return(false);
                }
            }
            else
            {
                flag = true;
            }
            if (!flag)
            {
                MessageManager.ShowMsgBox("INP-235309");
            }
            return(flag);
        }
Ejemplo n.º 4
0
        public void ChooseYHZCMCForFYXM()
        {
            DataTable table = new DAL.BMFYXMManager().QueryFYXMYHZCIsAndYHZCMCIsEmpty();

            if (table != null)
            {
                DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager();
                List <string>     sqlID    = new List <string>();
                List <Dictionary <string, object> > param = new List <Dictionary <string, object> >();
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    Dictionary <string, object> item = new Dictionary <string, object>();
                    string   str        = GetSafeData.ValidateValue <string>(table.Rows[i], "BM");
                    string   bm         = GetSafeData.ValidateValue <string>(table.Rows[i], "SPFL");
                    string   str3       = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZC");
                    string   sPFLMCBYBM = manager2.GetSPFLMCBYBM(bm);
                    string   str5       = "";
                    object[] objArray   = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { bm });
                    if ((objArray != null) && (objArray.Length > 0))
                    {
                        string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' });
                        if (strArray.Length > 0)
                        {
                            str5 = strArray[0];
                            if ((!Flbm.IsDK() && (strArray.Length == 1)) && strArray[0].Contains("1.5%"))
                            {
                                str3 = "否";
                                str5 = "";
                            }
                            if ((!Flbm.IsDK() && (strArray.Length > 1)) && strArray[0].Contains("1.5%"))
                            {
                                str5 = strArray[1];
                            }
                        }
                        else
                        {
                            str3 = "否";
                        }
                    }
                    else
                    {
                        str3 = "否";
                    }
                    item.Add("BM", str);
                    item.Add("SPFL", bm);
                    item.Add("SPFLMC", sPFLMCBYBM);
                    item.Add("YHZC", str3);
                    item.Add("YHZCMC", str5);
                    sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.UpdateFYXMSPFL");
                    param.Add(item);
                }
                new DAL.BMSPFLManager().UpdateSPFLTable(sqlID, param, false);
            }
        }
Ejemplo n.º 5
0
        public void checkspspfl()
        {
            DataTable table = new DAL.BMSPManager().QuerySPSPFLLNotEmptyAndNotXT();

            if (table != null)
            {
                DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager();
                List <string>     sqlID    = new List <string>();
                List <Dictionary <string, object> > param = new List <Dictionary <string, object> >();
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    Dictionary <string, object> item = new Dictionary <string, object>();
                    string str        = GetSafeData.ValidateValue <string>(table.Rows[i], "BM");
                    string bm         = GetSafeData.ValidateValue <string>(table.Rows[i], "SPFL");
                    string str3       = GetSafeData.ValidateValue <string>(table.Rows[i], "LSLVBS");
                    string str4       = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZC");
                    string str5       = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZCMC");
                    string sPFLMCBYBM = string.Empty;
                    item.Add("BM", str);
                    if (manager2.CanUseThisSPFLBM(bm, true, false))
                    {
                        item.Add("SPFL", bm);
                        sPFLMCBYBM = manager2.GetSPFLMCBYBM(bm);
                        item.Add("SPFLMC", sPFLMCBYBM);
                        if (manager2.CanUseThisYHZC(bm))
                        {
                            item.Add("YHZC", str4);
                            item.Add("YHZCMC", str5);
                            item.Add("LSLVBS", str3);
                        }
                        else
                        {
                            item.Add("YHZC", "否");
                            item.Add("YHZCMC", "");
                            item.Add("LSLVBS", "");
                        }
                    }
                    else
                    {
                        item.Add("SPFL", "");
                        item.Add("SPFLMC", "");
                        item.Add("YHZC", "");
                        item.Add("YHZCMC", "");
                        item.Add("LSLVBS", "");
                    }
                    sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.UpdateSPSPFL");
                    param.Add(item);
                }
                new DAL.BMSPFLManager().UpdateSPFLTable(sqlID, param, false);
            }
        }
Ejemplo n.º 6
0
        private List <Dictionary <string, object> > HandleWJJD(List <Dictionary <string, object> > listSPFL)
        {
            List <Dictionary <string, object> > list = listSPFL;
            DataTable sJBM = new DAL.BMSPFLManager().GetSJBM();

            try
            {
                for (int i = 0; i < list.Count; i++)
                {
                    list[i]["WJ"] = this.GetWJ(list[i]["BM"].ToString(), list, sJBM);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(list);
        }
Ejemplo n.º 7
0
 protected override object[] doService(object[] param)
 {
     if (param.Length == 2)
     {
         string            bm        = (string)param[0];
         bool              isSPBMSel = (bool)param[1];
         DAL.BMSPFLManager manager   = new DAL.BMSPFLManager();
         return(new object[] { manager.CanUseThisSPFLBM(bm, isSPBMSel, false) });
     }
     if (param.Length >= 3)
     {
         string            str2     = (string)param[0];
         bool              flag2    = (bool)param[1];
         bool              isXTSP   = (bool)param[2];
         DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager();
         return(new object[] { manager2.CanUseThisSPFLBM(str2, flag2, isXTSP) });
     }
     return(null);
 }
Ejemplo n.º 8
0
 private void aisinoDataGrid1_DataGridRowKeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if ((e.KeyCode == Keys.Enter) && (this.aisinoDataGrid1.SelectedRows.Count > 0))
         {
             string str = this.aisinoDataGrid1.SelectedRows[0].Cells["WJ"].Value.ToString();
             this.SelectBM   = this.aisinoDataGrid1.SelectedRows[0].Cells["BM"].Value.ToString();
             this.SelectBMMC = this.aisinoDataGrid1.SelectedRows[0].Cells["MC"].Value.ToString();
             string            str2    = this.aisinoDataGrid1.SelectedRows[0].Cells["HZX"].Value.ToString().Trim();
             DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
             if (this.Isxtsp)
             {
                 if (((str == "1") && (str2 == "N")) && manager.CanUseThisSPFLBM(this.SelectBM, true, true))
                 {
                     base.DialogResult = DialogResult.OK;
                     base.Close();
                     base.Dispose();
                 }
             }
             else
             {
                 bool isSPBMSel = BMType.BM_SP == this.GetBMType();
                 if (((str == "1") && (str2 == "N")) && manager.CanUseThisSPFLBM(this.SelectBM, isSPBMSel, false))
                 {
                     base.DialogResult = DialogResult.OK;
                     base.Close();
                     base.Dispose();
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error(exception.ToString());
         ExceptionHandler.HandleError(exception);
     }
 }
Ejemplo n.º 9
0
        public ImportResult ImportDataZC(string codeFile)
        {
            new Dictionary <string, object>();
            ImportResult result   = new ImportResult();
            XmlDocument  document = new XmlDocument();

            try
            {
                try
                {
                    document.Load(codeFile);
                }
                catch
                {
                    throw new Exception("不符合机动车编码格式");
                }
                XmlNode documentElement = document.DocumentElement;
                try
                {
                    if (documentElement.Attributes["TYPE"].Value != "JDCBIANMA")
                    {
                        throw new Exception("不符合机动车编码格式");
                    }
                }
                catch
                {
                    throw new Exception("不符合机动车编码格式");
                }
                XmlNodeList list = null;
                list = documentElement.SelectNodes("/Data/CLXX/Row");
                List <Dictionary <string, string> > list2 = new List <Dictionary <string, string> >();
                foreach (XmlNode node2 in list)
                {
                    Dictionary <string, string> item = new Dictionary <string, string>();
                    if (Flbm.IsYM())
                    {
                        if (node2.Attributes["SPFLBM"] == null)
                        {
                            item.Add("SPFLBM", "");
                        }
                        else
                        {
                            item.Add(node2.Attributes["SPFLBM"].Name, node2.Attributes["SPFLBM"].Value);
                        }
                    }
                    item.Add(node2.Attributes["SCQYMC"].Name, node2.Attributes["SCQYMC"].Value);
                    item.Add(node2.Attributes["DJ"].Name, node2.Attributes["DJ"].Value);
                    item.Add(node2.Attributes["CDMC"].Name, node2.Attributes["CDMC"].Value);
                    item.Add(node2.Attributes["CPXH"].Name, node2.Attributes["CPXH"].Value);
                    item.Add(node2.Attributes["CLLXMC"].Name, node2.Attributes["CLLXMC"].Value);
                    item.Add(node2.Attributes["CLDLMC"].Name, node2.Attributes["CLDLMC"].Value);
                    item.Add(node2.Attributes["CPBM"].Name, node2.Attributes["CPBM"].Value);
                    list2.Add(item);
                }
                DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
                foreach (Dictionary <string, string> dictionary2 in list2)
                {
                    BMCLModel car      = new BMCLModel();
                    string    searchid = "";
                    searchid   = this.bmclDAL.AutoNodeLogic(dictionary2["CLDLMC"]);
                    car.SJBM   = searchid;
                    car.BM     = this.TuiJianBM(searchid);
                    car.MC     = dictionary2["CLLXMC"];
                    car.SCCJMC = dictionary2["SCQYMC"];
                    car.CPXH   = dictionary2["CPXH"];
                    car.CD     = dictionary2["CDMC"];
                    if (Flbm.IsYM() && manager.CanUseThisSPFLBM(dictionary2["SPFLBM"], false, false))
                    {
                        car.SPFL   = dictionary2["SPFLBM"];
                        car.SPFLMC = manager.GetSPFLMCBYBM(car.SPFL);
                        if (!manager.CanUseThisYHZC(car.SPFL))
                        {
                            car.YHZC   = "否";
                            car.YHZCMC = "";
                        }
                    }
                    car.KJM = CommonFunc.GenerateKJM(car.MC);
                    car.WJ  = 1;
                    string str2 = this.AddCustomerToAuto(car, car.SJBM);
                    if ("OverWrite" == str2)
                    {
                        result.Correct++;
                        result.DtResult.Rows.Add(new object[] { car.BM, car.MC, "正确传入", "覆盖记录:" + car.BM });
                    }
                    else if ("Insert" == str2)
                    {
                        result.Correct++;
                        result.DtResult.Rows.Add(new object[] { car.BM, car.MC, "正确传入", "插入成功:" + car.BM });
                    }
                    else
                    {
                        result.Failed++;
                        result.DtResult.Rows.Add(new object[] { car.BM, car.MC, "失败", "数据库读写错误" });
                    }
                }
            }
            catch
            {
                throw;
            }
            result.ImportTable = "车辆编码.DB";
            return(result);
        }
Ejemplo n.º 10
0
        public ImportResult ImportData(string codeFile)
        {
            ImportResult result2;

            try
            {
                string[] strArray = File.ReadAllLines(codeFile, ToolUtil.GetEncoding());
                if (strArray.Length == 0)
                {
                    throw new CustomException("此文件没有内容");
                }
                string str   = "";
                int    index = 0;
                bool   flag  = true;
                while (flag)
                {
                    if (strArray[index].StartsWith("{车辆编码}"))
                    {
                        string str2 = strArray[index];
                        if (!str2.Contains("\""))
                        {
                            throw new CustomException("此文件首行车辆编码没有指定分隔符,分隔符使用双引号标注");
                        }
                        str  = str2.Substring(str2.IndexOf("\"")).Trim().Trim(new char[] { '"' });
                        flag = false;
                        index++;
                    }
                    else
                    {
                        index++;
                        if (index == strArray.Length)
                        {
                            throw new CustomException("此文件不符合车辆编码文本格式");
                        }
                    }
                }
                ImportResult     result = new ImportResult();
                Stack <lastBMJG> stack  = new Stack <lastBMJG>();
                string           str4   = this.TuiJianBM("");
                string           str5   = "";
                bool             flag2  = false;
                for (int i = index; i < strArray.Length; i++)
                {
                    BMCLModel model;
                    string    lineText = strArray[i].Trim();
                    if (((lineText.Length == 0) || lineText.StartsWith("//")) || !lineText.Contains(str))
                    {
                        continue;
                    }
                    string[] strArray2 = GetSafeData.Split(lineText, str);
                    if (strArray2.Length < 3)
                    {
                        throw new CustomException("文本首行指定的分隔符与实际分隔符不一致,\n格式不正确等原因导致不能导入此文件!");
                    }
                    model = new BMCLModel {
                        BM = strArray2[0],
                        MC = strArray2[1],
                        JM = strArray2[2],
                    };
                    model.KJM = CommonFunc.GenerateKJM(model.MC);
                    string     str7 = "";
                    string     str8 = "";
                    ResultType none = ResultType.None;
                    if (strArray2.Length > 3)
                    {
                        if (strArray2.Length < 6)
                        {
                            throw new CustomException(string.Format("第{0}行数据不全", i));
                        }
                        model.WJ = 1;
                        string str9 = "";
                        if (str == "~~")
                        {
                            str9 = strArray2[3].Replace(",", "\r\n").Replace("#|#", "\r\n");
                        }
                        else if (str == " ")
                        {
                            str9 = strArray2[3].Replace("#|#", "\r\n");
                        }
                        else
                        {
                            str9 = strArray2[3];
                        }
                        model.CPXH = str9;
                        string str10 = "";
                        if (str == "~~")
                        {
                            str10 = strArray2[4].Replace(",", "\r\n").Replace("#|#", "\r\n");
                        }
                        else if (str == " ")
                        {
                            str10 = strArray2[4].Replace("#|#", "\r\n");
                        }
                        else
                        {
                            str10 = strArray2[4];
                        }
                        model.CD = str10;
                        string str11 = "";
                        if (str == "~~")
                        {
                            str11 = strArray2[5].Replace(",", "\r\n").Replace("#|#", "\r\n");
                        }
                        else if (str == " ")
                        {
                            str11 = strArray2[5].Replace("#|#", "\r\n");
                        }
                        else
                        {
                            str11 = strArray2[5];
                        }
                        model.SCCJMC = str11;
                        if (Flbm.IsYM() && (strArray2.Length > 6))
                        {
                            DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
                            string            bm      = "";
                            if (str == "~~")
                            {
                                bm = strArray2[6].Replace(",", "\r\n").Replace("#|#", "\r\n");
                            }
                            else if (str == " ")
                            {
                                bm = strArray2[6].Replace("#|#", "\r\n");
                            }
                            else
                            {
                                bm = strArray2[6];
                            }
                            if (strArray2.Length > 7)
                            {
                                string str13 = "";
                                if (str == "~~")
                                {
                                    str13 = strArray2[7].Replace(",", "\r\n").Replace("#|#", "\r\n");
                                }
                                else if (str == " ")
                                {
                                    str13 = strArray2[7].Replace("#|#", "\r\n");
                                }
                                else
                                {
                                    str13 = strArray2[7];
                                }
                                if (manager.CanUseThisSPFLBM(bm, false, false))
                                {
                                    model.SPFL   = bm;
                                    model.SPFLMC = manager.GetSPFLMCBYBM(bm);
                                    if (manager.CanUseThisYHZC(bm))
                                    {
                                        if ((str13.Trim() == "是") || (str13.Trim() == "否"))
                                        {
                                            model.YHZC = str13;
                                            if (model.YHZC == "否")
                                            {
                                                model.YHZCMC = "";
                                            }
                                        }
                                        else
                                        {
                                            model.YHZC   = "否";
                                            model.YHZCMC = "";
                                        }
                                        if (strArray2.Length > 9)
                                        {
                                            bool flag3 = false;
                                            if (str13.Trim() == "是")
                                            {
                                                object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { model.SPFL });
                                                if ((objArray != null) && (objArray.Length > 0))
                                                {
                                                    string[] strArray3 = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' });
                                                    if (strArray3.Length > 0)
                                                    {
                                                        foreach (string str14 in strArray3)
                                                        {
                                                            if (strArray2[9].Trim() == str14)
                                                            {
                                                                model.YHZC = "是";
                                                                string str15 = "";
                                                                if (str == "~~")
                                                                {
                                                                    str15 = strArray2[9].Replace(",", "\r\n").Replace("#|#", "\r\n");
                                                                }
                                                                else if (str == " ")
                                                                {
                                                                    str15 = strArray2[9].Replace("#|#", "\r\n");
                                                                }
                                                                else
                                                                {
                                                                    str15 = strArray2[9];
                                                                }
                                                                model.YHZCMC = str15;
                                                                flag3        = true;
                                                            }
                                                            if (!Flbm.IsDK() && strArray2[9].Trim().Contains("1.5%"))
                                                            {
                                                                model.YHZC   = "否";
                                                                model.YHZCMC = "";
                                                            }
                                                        }
                                                    }
                                                }
                                                if (!flag3)
                                                {
                                                    model.YHZC   = "否";
                                                    model.YHZCMC = "";
                                                }
                                            }
                                            else if (str13.Trim() == "否")
                                            {
                                                model.YHZC   = "否";
                                                model.YHZCMC = "";
                                            }
                                            else
                                            {
                                                model.YHZC   = "否";
                                                model.YHZCMC = "";
                                            }
                                        }
                                    }
                                    else
                                    {
                                        model.YHZC   = "否";
                                        model.YHZCMC = "";
                                    }
                                }
                            }
                        }
                    }
                    while (stack.Count > 0)
                    {
                        flag2 = false;
                        if (model.BM.Length > stack.Peek().BM.Length)
                        {
                            if (!model.BM.StartsWith(stack.Peek().BM))
                            {
                                goto Label_07AE;
                            }
                            model.SJBM = stack.Peek().BM;
                            if (stack.Peek().Result == ResultType.Invalid)
                            {
                                str7 = "无效";
                                str8 = "上级编码无效";
                                none = ResultType.Invalid;
                                result.Invalid++;
                            }
                            else if (stack.Peek().Result == ResultType.Failed)
                            {
                                str7 = "失败";
                                str8 = "上级编码失败";
                                none = ResultType.Failed;
                                result.Failed++;
                            }
                            else
                            {
                                if (stack.Peek().Result != ResultType.Duplicated)
                                {
                                    goto Label_07AE;
                                }
                                str5 = this.TuiJianBM(stack.Peek().BM);
                                if (model.BM.Length == str5.Length)
                                {
                                    goto Label_07AE;
                                }
                                str7 = "无效";
                                str8 = "编码长度必须与原有同级编码长度一致";
                                result.Invalid++;
                                none = ResultType.Invalid;
                            }
                            goto Label_0940;
                        }
                        stack.Pop();
                    }
                    flag2 = true;
Label_07AE:
                    if ((flag2 && (str4 != "001")) && (model.BM.Length != str4.Length))
                    {
                        str7 = "无效";
                        str8 = "编码长度必须与原有同级编码长度一致";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if ("0" != this.CheckCustomer(model))
                    {
                        str7 = "无效";
                        str8 = "编码或名称为空";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if (!Regex.IsMatch(model.BM, "^[0-9a-z]{1,16}$"))
                    {
                        str7 = "无效";
                        str8 = "编码需小于16位,且仅由数字和小写字母组成";
                        result.Invalid++;
                        none = ResultType.Invalid;
                    }
                    else if (this.bmclDAL.ExistCustomer(model))
                    {
                        if (str7.Length == 0)
                        {
                            str7 = "重复";
                            result.Duplicated++;
                        }
                        if (str8.Length == 0)
                        {
                            str8 = "编码重复";
                            none = ResultType.Duplicated;
                        }
                        else
                        {
                            str8 = str8 + "且编码重复";
                            none = ResultType.Invalid;
                        }
                    }
                    else
                    {
                        string[] spellCode = StringUtils.GetSpellCode(model.MC);
                        for (int j = 0; j < spellCode.Length; j++)
                        {
                            string text1 = spellCode[j];
                        }
                        if (this.bmclDAL.AddCustomer(model) == "0")
                        {
                            str7 = "正确传入";
                            result.Correct++;
                            none = ResultType.Correct;
                        }
                        else
                        {
                            str7 = "失败";
                            result.Failed++;
                            none = ResultType.Failed;
                        }
                    }
                    Label_0940 :;
                    result.DtResult.Rows.Add(new object[] { model.BM, model.MC, str7, str8 });
                    stack.Push(new lastBMJG(model.BM, none));
                }
                result.ImportTable = "车辆编码.DB";
                result2            = result;
            }
            catch
            {
                throw;
            }
            return(result2);
        }
Ejemplo n.º 11
0
        public ImportResult ImportDataSPFL(string codeFile)
        {
            Dictionary <string, object> dictionary;
            ImportResult result   = new ImportResult();
            XmlDocument  document = new XmlDocument();

            try
            {
                document.Load(codeFile);
                XmlNode documentElement = document.DocumentElement;
                if ((documentElement.Attributes["id"].Value != "spbm") && (documentElement.Attributes["id"].Value != "SPBM"))
                {
                    throw new Exception("导入税收分类编码文件格式不正确!");
                }
            }
            catch
            {
                throw new Exception("导入税收分类编码文件格式不正确!");
            }
            string      innerText         = document.GetElementsByTagName("MWJY")[0].InnerText;
            string      text1             = document.GetElementsByTagName("COUNT")[0].InnerText;
            string      str               = string.Empty;
            XmlNodeList elementsByTagName = document.GetElementsByTagName("BBH");

            if ((elementsByTagName == null) || (elementsByTagName.Count < 1))
            {
                throw new Exception("导入税收分类编码版本号异常!");
            }
            string maxBMBBBH = this.GetMaxBMBBBH();
            string s         = elementsByTagName[0].InnerText;

            if (float.Parse(maxBMBBBH) >= float.Parse(s))
            {
                throw new Exception("导入文件中税收分类编码版本号过低,系统不允许导入!");
            }
            List <string> sqlID = new List <string>();
            List <Dictionary <string, object> > listSPFL = new List <Dictionary <string, object> >();
            XmlNodeList list6 = document.GetElementsByTagName("BMXX");

            for (int i = 0; i < list6.Count; i++)
            {
                dictionary = new Dictionary <string, object>();
                XmlNodeList childNodes = list6[i].ChildNodes;
                if (childNodes != null)
                {
                    dictionary.Add("BMB_BBH", s);
                    foreach (XmlNode node2 in childNodes)
                    {
                        switch (node2.Name)
                        {
                        case "SPBM":
                        {
                            dictionary.Add("HBBM", node2.InnerText);
                            str = str + node2.InnerText;
                            string bM = this.GetBM(node2.InnerText);
                            dictionary.Add("BM", bM);
                            dictionary.Add("SJBM", this.GetSJBM(bM));
                            continue;
                        }

                        case "SPMC":
                        {
                            dictionary.Add("MC", node2.InnerText);
                            continue;
                        }

                        case "SM":
                        {
                            dictionary.Add("SM", node2.InnerText);
                            continue;
                        }

                        case "ZZSSL":
                        {
                            dictionary.Add("SLV", node2.InnerText);
                            str = str + node2.InnerText;
                            continue;
                        }

                        case "GJZ":
                        {
                            dictionary.Add("GJZ", node2.InnerText);
                            continue;
                        }

                        case "HZX":
                        {
                            dictionary.Add("HZX", node2.InnerText);
                            continue;
                        }

                        case "BB":
                        {
                            dictionary.Add("BBH", node2.InnerText);
                            continue;
                        }

                        case "KYZT":
                        {
                            dictionary.Add("KYZT", node2.InnerText);
                            continue;
                        }

                        case "ZZSTSGL":
                        {
                            dictionary.Add("ZZSTSGL", node2.InnerText);
                            str = str + node2.InnerText;
                            continue;
                        }

                        case "ZZSZCYJ":
                        {
                            dictionary.Add("ZZSZCYJ", node2.InnerText);
                            continue;
                        }

                        case "ZZSTSNRDM":
                        {
                            dictionary.Add("ZZSTSNRDM", node2.InnerText);
                            continue;
                        }

                        case "XFSGL":
                        {
                            dictionary.Add("XFSGL", node2.InnerText);
                            continue;
                        }

                        case "XFSZCYJ":
                        {
                            dictionary.Add("XFSZCYJ", node2.InnerText);
                            continue;
                        }

                        case "XFSTSNRDM":
                        {
                            dictionary.Add("XFSTSNRDM", node2.InnerText);
                            continue;
                        }

                        case "TJJBM":
                        {
                            dictionary.Add("TJJBM", node2.InnerText);
                            continue;
                        }

                        case "HGJCKSPPM":
                        {
                            dictionary.Add("HGJCKSPPM", node2.InnerText);
                            continue;
                        }

                        case "QYSJ":
                        {
                            dictionary.Add("QYSJ", node2.InnerText);
                            continue;
                        }

                        case "GDQJZSJ":
                        {
                            dictionary.Add("GDQJZSJ", node2.InnerText);
                            continue;
                        }

                        case "GXSJ":
                        {
                            if (node2.InnerText.Trim().Length <= 8)
                            {
                                break;
                            }
                            dictionary.Add("GXSJ", DateTime.Parse(node2.InnerText));
                            continue;
                        }

                        default:
                        {
                            continue;
                        }
                        }
                        DateTime time = DateTime.ParseExact(node2.InnerText, "yyyyMMdd", CultureInfo.CurrentCulture, DateTimeStyles.AllowWhiteSpaces);
                        dictionary.Add("GXSJ", time);
                    }
                    sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.ReplaceSPFL");
                    listSPFL.Add(dictionary);
                }
            }
            if ((listSPFL != null) && (listSPFL.Count > 1))
            {
                listSPFL = this.HandleWJJD(listSPFL);
            }
            XmlNodeList list8 = document.GetElementsByTagName("ZZSYHZC");

            if ((list8 != null) && (list8.Count > 1))
            {
                //Dictionary<string, object> dictionary2;
                //dictionary2 = new Dictionary<string, object> {
                //    "aisino.Fwkp.Bmgl.BMSPFL.DeleteYHZC",
                //    dictionary2
                //};
                foreach (XmlNode node3 in list8)
                {
                    dictionary = new Dictionary <string, object>();
                    XmlNodeList list9 = node3.ChildNodes;
                    if ((list9 != null) && (list9.Count >= 1))
                    {
                        dictionary = new Dictionary <string, object>();
                        foreach (XmlNode node4 in list9)
                        {
                            string name = node4.Name;
                            if (name != null)
                            {
                                if (!(name == "YHZCMC"))
                                {
                                    if (name == "SL")
                                    {
                                        goto Label_06B5;
                                    }
                                }
                                else
                                {
                                    dictionary.Add("Yhzcmc", node4.InnerText);
                                    str = str + node4.InnerText;
                                }
                            }
                            continue;
Label_06B5:
                            dictionary.Add("SLv", node4.InnerText);
                            str = str + node4.InnerText;
                        }
                        sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.InsertYHZC");
                        listSPFL.Add(dictionary);
                    }
                }
            }
            str = str + "0123456789";
            string str6 = this.UserMd5(str);

            DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
            if (!(str6 == innerText))
            {
                throw new Exception("密文校验失败!");
            }
            if (!manager.UpdateSPFLTable(sqlID, listSPFL, false))
            {
                throw new Exception("税收分类编码导入失败!");
            }
            this.checkspspfl();
            this.checkclspfl();
            this.checkfyxmspfl();
            new SPFLService().UpdateBMBBBH(s);
            MessageBoxHelper.Show("税收分类编码导入成功!", "正确", MessageBoxButtons.OK, MessageBoxIcon.None);
            result.ImportTable = "税收分类编码.DB";
            return(result);
        }
Ejemplo n.º 12
0
 public string GetMaxBMBBBH()
 {
     DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
     return(manager.GetSBBPBBH());
 }
Ejemplo n.º 13
0
        public void AutoImportDatabase(string codeFile)
        {
            Dictionary <string, object> dictionary;
            XmlDocument document = new XmlDocument();

            document.Load(codeFile);
            string      innerText         = document.GetElementsByTagName("MWJY")[0].InnerText;
            string      text1             = document.GetElementsByTagName("COUNT")[0].InnerText;
            string      str               = string.Empty;
            XmlNodeList elementsByTagName = document.GetElementsByTagName("BBH");

            if (elementsByTagName != null)
            {
                int count = elementsByTagName.Count;
            }
            string maxBMBBBH = this.GetMaxBMBBBH();
            string s         = elementsByTagName[0].InnerText;

            float.Parse(s);
            float.Parse(maxBMBBBH);
            List <string> sqlID = new List <string>();
            List <Dictionary <string, object> > listSPFL = new List <Dictionary <string, object> >();
            XmlNodeList list6 = document.GetElementsByTagName("BMXX");

            for (int i = 0; i < list6.Count; i++)
            {
                dictionary = new Dictionary <string, object>();
                XmlNodeList childNodes = list6[i].ChildNodes;
                if (childNodes != null)
                {
                    dictionary.Add("BMB_BBH", s);
                    foreach (XmlNode node in childNodes)
                    {
                        switch (node.Name)
                        {
                        case "SPBM":
                        {
                            dictionary.Add("HBBM", node.InnerText);
                            str = str + node.InnerText;
                            string bM = this.GetBM(node.InnerText);
                            dictionary.Add("BM", bM);
                            dictionary.Add("SJBM", this.GetSJBM(bM));
                            continue;
                        }

                        case "SPMC":
                        {
                            dictionary.Add("MC", node.InnerText);
                            continue;
                        }

                        case "SM":
                        {
                            dictionary.Add("SM", node.InnerText);
                            continue;
                        }

                        case "ZZSSL":
                        {
                            dictionary.Add("SLV", node.InnerText);
                            str = str + node.InnerText;
                            continue;
                        }

                        case "GJZ":
                        {
                            dictionary.Add("GJZ", node.InnerText);
                            continue;
                        }

                        case "HZX":
                        {
                            dictionary.Add("HZX", node.InnerText);
                            continue;
                        }

                        case "BB":
                        {
                            dictionary.Add("BBH", node.InnerText);
                            continue;
                        }

                        case "KYZT":
                        {
                            dictionary.Add("KYZT", node.InnerText);
                            continue;
                        }

                        case "ZZSTSGL":
                        {
                            dictionary.Add("ZZSTSGL", node.InnerText);
                            str = str + node.InnerText;
                            continue;
                        }

                        case "ZZSZCYJ":
                        {
                            dictionary.Add("ZZSZCYJ", node.InnerText);
                            continue;
                        }

                        case "ZZSTSNRDM":
                        {
                            dictionary.Add("ZZSTSNRDM", node.InnerText);
                            continue;
                        }

                        case "XFSGL":
                        {
                            dictionary.Add("XFSGL", node.InnerText);
                            continue;
                        }

                        case "XFSZCYJ":
                        {
                            dictionary.Add("XFSZCYJ", node.InnerText);
                            continue;
                        }

                        case "XFSTSNRDM":
                        {
                            dictionary.Add("XFSTSNRDM", node.InnerText);
                            continue;
                        }

                        case "TJJBM":
                        {
                            dictionary.Add("TJJBM", node.InnerText);
                            continue;
                        }

                        case "HGJCKSPPM":
                        {
                            dictionary.Add("HGJCKSPPM", node.InnerText);
                            continue;
                        }

                        case "QYSJ":
                        {
                            dictionary.Add("QYSJ", node.InnerText);
                            continue;
                        }

                        case "GDQJZSJ":
                        {
                            dictionary.Add("GDQJZSJ", node.InnerText);
                            continue;
                        }

                        case "GXSJ":
                        {
                            if (node.InnerText.Trim().Length <= 8)
                            {
                                break;
                            }
                            dictionary.Add("GXSJ", DateTime.Parse(node.InnerText));
                            continue;
                        }

                        default:
                        {
                            continue;
                        }
                        }
                        DateTime time = DateTime.ParseExact(node.InnerText, "yyyyMMdd", CultureInfo.CurrentCulture, DateTimeStyles.AllowWhiteSpaces);
                        dictionary.Add("GXSJ", time);
                    }
                    sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.ReplaceSPFL");
                    listSPFL.Add(dictionary);
                }
            }
            if ((listSPFL != null) && (listSPFL.Count > 1))
            {
                listSPFL = this.HandleWJJD(listSPFL);
            }
            XmlNodeList list8 = document.GetElementsByTagName("ZZSYHZC");

            if ((list8 != null) && (list8.Count > 1))
            {
                //Dictionary<string, object> dictionary2;
                //dictionary2 = new Dictionary<string, object> {
                //    "aisino.Fwkp.Bmgl.BMSPFL.DeleteYHZC",
                //    dictionary2
                //};
                foreach (XmlNode node2 in list8)
                {
                    dictionary = new Dictionary <string, object>();
                    XmlNodeList list9 = node2.ChildNodes;
                    if ((list9 != null) && (list9.Count >= 1))
                    {
                        dictionary = new Dictionary <string, object>();
                        foreach (XmlNode node3 in list9)
                        {
                            string name = node3.Name;
                            if (name != null)
                            {
                                if (!(name == "YHZCMC"))
                                {
                                    if (name == "SL")
                                    {
                                        goto Label_0634;
                                    }
                                }
                                else
                                {
                                    dictionary.Add("Yhzcmc", node3.InnerText);
                                    str = str + node3.InnerText;
                                }
                            }
                            continue;
Label_0634:
                            dictionary.Add("SLv", node3.InnerText);
                            str = str + node3.InnerText;
                        }
                        sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.InsertYHZC");
                        listSPFL.Add(dictionary);
                    }
                }
            }
            str = str + "0123456789";
            string str6 = this.UserMd5(str);

            DAL.BMSPFLManager manager = new DAL.BMSPFLManager();
            if ((str6 == innerText) && manager.UpdateSPFLTable(sqlID, listSPFL, false))
            {
                new SPFLService().UpdateBMBBBH(s);
            }
        }