Beispiel #1
0
        internal void ShowDialog(string contract, string set_g, string stage_g, string stage_name, string set_code, string set_name, string gip_start, string gip_end, string connString, clUser current_user, string set_st, string set_en)
        {
            set_guid   = set_g;
            stage_guid = stage_g;
            conn       = connString;

            user             = current_user;
            lblContract.Text = contract;
            lblStage.Text    = stage_name;
            lblSetCode.Text  = set_code;

            DateTime dt;

            if (DateTime.TryParse(gip_start, out dt))
            {
                gip_start = dt.ToShortDateString();
            }
            if (DateTime.TryParse(gip_end, out dt))
            {
                gip_end = dt.ToShortDateString();
            }

            lblGipStart.Text = gip_start;
            lblGipEnd.Text   = gip_end;

            if (DateTime.TryParse(set_st, out set_start) && DateTime.TryParse(set_en, out set_end))
            {
                int days = (set_end - set_start).Days;
                set_start = set_start.AddMonths(1);
                DateTime new_set_start = new DateTime(set_start.Year, set_start.Month, 1, 0, 0, 0);
                dtpNewStartDate.Value = new_set_start;
                new_set_start         = new_set_start.AddDays(days);
                dtpNewEndDate.Value   = new_set_start;
            }


            this.ShowDialog();
        }
Beispiel #2
0
        internal void ShowDialog(ref clSet set, string connString, clUser current_user)
        {
            set_guid   = set.SetGuid;
            stage_guid = set.StageGuid;
            conn       = connString;

            agreed_start = set.SetStart.ToShortDateString();
            agreed_end   = set.SetEnd.ToShortDateString();

            user             = current_user;
            lblContract.Text = set.Contract;
            lblStage.Text    = set.StageName;
            lblSetCode.Text  = set.SetCode;

            /*DateTime dt;
             * if (DateTime.TryParse(set.GipStart, out dt))
             *  gip_start = dt.ToShortDateString();
             * if (DateTime.TryParse(gip_end, out dt))
             *  gip_end = dt.ToShortDateString();*/

            lblGipStart.Text = set.GipStart.ToShortDateString();
            lblGipEnd.Text   = set.GipEnd.ToShortDateString();



            if (DateTime.TryParse(set.SetStart.ToShortDateString(), out set_start) && DateTime.TryParse(set.SetEnd.ToShortDateString(), out set_end))
            {
                int days = (set_end - set_start).Days;
                set_start             = new DateTime(DateTime.Now.Year, DateTime.Now.AddMonths(1).Month, 1, 0, 0, 0);
                dtpNewStartDate.Value = set_start;
                set_start             = set_start.AddDays(days);
                dtpNewEndDate.Value   = set_start;
            }


            this.ShowDialog();
        }