예제 #1
0
 private void SetModelToUI(clothing dto)
 {
     button4.Enabled       = false;
     dateTimePicker1.Value = dto.Filled;
     listBox1.Items.Clear();
     foreach (var e in dto.Goods)
     {
         listBox1.Items.Add(e);
     }
     numericUpDown1.Value = dto.Price;
 }
예제 #2
0
    public string GetBarCode(string tag)
    {
        string        text          = "<?xml version=\"1.0\" encoding=\"gb2312\"?><FeedBack>";
        string        cmdText       = string.Format("select a.ypmc,a.yphh,ROUND(yfcbdj,2) as yfcbdj,a.mlcf,isnull(a.tydddj,0) tydddj,lsdj,cjyphh,bjid,a.bq, xl.mc xlmc, a.bhksid, a.bhks from  yx_t_ypdmb as  a    left join yf_T_kfbh AS  kf on a.kfbh=kf.dm and a.tzid=kf.tzid left join t_xtdm AS  xl on a.fg=xl.dm and xl.ssid=401 and xl.tzid=1 WHERE a.bq='{0}' OR a.yphh ='{0}' ", tag);
        SqlConnection sqlConnection = new SqlConnection();

        sqlConnection.ConnectionString = "server='192.168.35.10';uid=ABEASD14AD;pwd=+AuDkDew;database=tlsoft";
        if (sqlConnection.State == ConnectionState.Open)
        {
            sqlConnection.Close();
        }
        sqlConnection.Open();
        using (SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection))
        {
            SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
            while (sqlDataReader.Read())
            {
                string   bjid     = sqlDataReader[7].ToString();
                clothing clothing = this.getClothing(bjid);
                string   bx       = this.getBx(sqlDataReader["bhksid"].ToString());
                if (bx == "")
                {
                    bx = this.getBx(sqlDataReader["bhks"].ToString());
                }
                text += string.Format("<tag ypmc=\"{0}\" yphh=\"{1}\" yfcbdj=\"{2}\" mlcf=\"{3}\" tydddj=\"{4}\" lsdj=\"{5}\" tagCode=\"{6}\" nd=\"{7}\" ml=\"{8}\" cjyphh=\"{9}\" xlmc=\"{10}\"  bx=\"{11}\" />", new object[]
                {
                    sqlDataReader["ypmc"],
                    sqlDataReader["yphh"],
                    sqlDataReader["yfcbdj"],
                    sqlDataReader["mlcf"],
                    sqlDataReader["tydddj"],
                    sqlDataReader["lsdj"],
                    sqlDataReader["bq"],
                    clothing.nd,
                    clothing.ml,
                    sqlDataReader["cjyphh"],
                    sqlDataReader["xlmc"],
                    bx
                });
            }
            sqlConnection.Close();
        }
        text += "</FeedBack>";
        return(text);
    }