Ejemplo n.º 1
0
 public ConditionBChooseForm(global::Helper.CompanyKind kind)
 {
     InitializeComponent();
     this.newChooseCustomer.Choose = new  Settings.BasicData.Customs.ChooseCustoms();
     this.kind = kind;
     this.labelControl3.Text = kind == global::Helper.CompanyKind.Customer ? Properties.Resources.Customer : Properties.Resources.Supplier;
 }
Ejemplo n.º 2
0
        public static string GetNewId(DateTime datetime, Helper.CompanyKind companyKind)
        {
            string invoiceKind = companyKind.ToString();
            string rule        = null;

            rule = Settings.Get("CompanyNumberRuleOf" + invoiceKind.ToUpper());
            if (string.IsNullOrEmpty(rule))
            {
                return(string.Empty);
            }
            string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, datetime.Year);
            string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, datetime.Year, datetime.Month);
            string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, datetime.ToString("yyyy-MM-dd"));

            string sequencekey = invoiceKind;

            if (rule.IndexOf("{D2}") >= 0)
            {
                sequencekey = sequencekey_d;
            }
            else if (rule.IndexOf("{M2}") >= 0)
            {
                sequencekey = sequencekey_m;
            }
            else if (rule.IndexOf("{Y2}") >= 0 || rule.IndexOf("{Y4}") >= 0)
            {
                sequencekey = sequencekey_y;
            }
            else
            {
                sequencekey = invoiceKind;
            }


            int sequenceval = SequenceManager.GetCurrentVal(sequencekey);

            sequenceval++;

            string d2 = string.Format("{0:d2}", datetime.Day);
            string m2 = string.Format("{0:d2}", datetime.Month);
            string y2 = string.Format("{0:d2}", datetime.Year);
            string y4 = string.Format("{0:d4}", datetime.Year);
            string n4 = string.Format("{0:d5}", sequenceval);

            string Id = rule.Replace("{D2}", d2).Replace("{M2}", m2).Replace("{Y2}", y2).Replace("{Y4}", y4).Replace("{N}", n4);

            return(Id);
        }
Ejemplo n.º 3
0
 public IList <Book.Model.InvoiceDetail01> Select1(DateTime start, DateTime end, string startId, string endId, Helper.CompanyKind companyKind)
 {
     return(accessor.Select1(start, end, startId, endId, companyKind));
 }
Ejemplo n.º 4
0
        public IList <Book.Model.InvoiceDetail01> Select1(DateTime start, DateTime end, string startId, string endId, Helper.CompanyKind companyKind)
        {
            Hashtable table = new Hashtable();

            table.Add("start", start);
            table.Add("end", end);
            table.Add("startId", startId);
            table.Add("endId", endId);
            switch (companyKind)
            {
            case global::Helper.CompanyKind.Customer:
                return(sqlmapper.QueryForList <Model.InvoiceDetail01>("InvoiceDetail01.select_byDateRengeAndCustomer1", table));

            case global::Helper.CompanyKind.Supplier:
                return(sqlmapper.QueryForList <Model.InvoiceDetail01>("InvoiceDetail01.select_byDateRengeAndSupplier1", table));

            default:
                return(null);
            }
        }
Ejemplo n.º 5
0
 public ChooseCompany(Helper.CompanyKind kind)
 {
     _kind = kind;
 }