Esempio n. 1
0
        public static string GetDWMC(string dwbm)
        {
            string str  = string.Format("select Unitname  from UNIT where  Unitcode='{0}'", dwbm);
            string swmc = DBUnity.ExecuteScalar(CommandType.Text, str, null);

            return(swmc);
        }
Esempio n. 2
0
        public static Print_State AddPrint_State(Print_State print_State)
        {
            string sql =
                "INSERT Print_State (PrintBH, PrintState, PrintTimes)" +
                "VALUES (@PrintBH, @PrintState, @PrintTimes)";

            sql += " ; SELECT @@IDENTITY";

            try
            {
                SqlParameter[] para = new SqlParameter[]
                {
                    new SqlParameter("@PrintBH", print_State.PrintBH),
                    new SqlParameter("@PrintState", print_State.PrintState),
                    new SqlParameter("@PrintTimes", print_State.PrintTimes)
                };

                string IdStr = DBUnity.ExecuteScalar(CommandType.Text, sql, para);
                int    newId = Convert.ToInt32(IdStr);
                return(GetPrint_StateByPtintID(newId));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
Esempio n. 3
0
        public static string GETCFDDNAMEBYCODE(string dwbm, string code)
        {
            string ss  = "";
            string str = "select BLNAME from BasLocationCode where ORGANCODE='{0}' and BLCODE={1}";
            string sql = string.Format(str, dwbm, code);

            ss = DBUnity.ExecuteScalar(CommandType.Text, sql, null);
            return(ss);
        }
Esempio n. 4
0
        public static int GetIDByBH(string KPBH)
        {
            DataTable dt = new DataTable();
            int       t  = 0;

            try
            {
                string sqlStr = "select PtintID from  dbo.Print_State where PrintBH='{0}'";
                sqlStr = string.Format(sqlStr, KPBH);
                t      = common.IntSafeConvert(DBUnity.ExecuteScalar(CommandType.Text, sqlStr, null));
            }
            catch (Exception ex)
            {
            }
            return(t);
        }