コード例 #1
0
ファイル: T_grn.cs プロジェクト: asachanxxx/SmartAnything
        public static void IncrementSerial(string screenname)
        {
            P_AutoNumberDL pal   = new P_AutoNumberDL();
            P_AutoNumber   pauto = new P_AutoNumber();

            pauto.Screen  = screenname;
            pauto         = pal.Selectp_AutoNumber(pauto);
            pauto.Serial += 1;
            pal.SaveP_AutoNumberSP(pauto, 3);
        }
コード例 #2
0
        public static string GetSerial(string screenname, string loca, string form)
        {
            string strserial = string.Empty;

            P_AutoNumberDL pal   = new P_AutoNumberDL();
            P_AutoNumber   pauto = new P_AutoNumber();

            pauto.Screen = screenname;
            pauto        = pal.Selectp_AutoNumber(pauto);
            decimal dec = (decimal)pauto.Serial;

            dec      += 1;
            strserial = dec.ToString("00000000");

            strserial = form.Trim().ToUpper() + "-" + loca.Trim() + "-" + strserial;

            return(strserial);
        }
コード例 #3
0
        /// <summary>
        /// Get the 4 method specific serials
        /// 1.	Entirely system generated only digit serial numbers
        /// 2.	System generated formatted serial numbers
        /// 3.	Entirely manual serial numbers
        /// 4.	location and prefix specific serial numbers
        /// </summary>
        /// <param name="screenname">Screen Name Like A0001</param>
        /// <returns></returns>
        public static string GetSerial(string screenname)
        {
            string strserial = string.Empty;

            P_AutoNumberDL pal   = new P_AutoNumberDL();
            P_AutoNumber   pauto = new P_AutoNumber();

            pauto.Screen = screenname;
            pauto        = pal.Selectp_AutoNumber(pauto);

            if (pauto.Mode == 1)
            {
                decimal dec = (decimal)pauto.Serial;
                dec      += 1;
                strserial = dec.ToString("0000000000");
            }
            else if (pauto.Mode == 2)
            {
                decimal dec = (decimal)pauto.Serial;
                dec      += 1;
                strserial = dec.ToString("0000000000");
                strserial = pauto.Prefix.Trim() + "-" + strserial;
            }
            else if (pauto.Mode == 3)
            {
                strserial = "";
            }
            else if (pauto.Mode == 4)
            {
                decimal dec = (decimal)pauto.Serial;
                dec      += 1;
                strserial = dec.ToString("0000000000");
                strserial = pauto.Prefix.Trim() + "-" + commonFunctions.GlobalLocation.Trim().ToUpper() + "-" + strserial;
            }
            return(strserial);
        }