Пример #1
0
    public void ListView(object sender)
    {
        string   region         = ((object[])sender)[0].ToString();
        string   workcenter     = ((object[])sender)[1].ToString();
        string   para_starttime = ((object[])sender)[2].ToString();
        string   para_endtime   = ((object[])sender)[3].ToString();
        DateTime starttime      = DateTime.Now;
        DateTime endtime        = DateTime.Now;

        if (region != "")
        {
            Region r = TheRegionMgr.LoadRegion(region);
            if (r == null)
            {
                ShowWarningMessage("MasterData.WorkCalendar.WarningMessage.RegionInvalid", region);
                return;
            }
        }
        if (workcenter != "")
        {
            WorkCenter r = TheWorkCenterMgr.LoadWorkCenter(workcenter);
            if (r == null)
            {
                ShowWarningMessage("MasterData.WorkCalendar.WarningMessage.WorkCenterInvalid", workcenter);
                return;
            }
        }
        try
        {
            starttime = Convert.ToDateTime(para_starttime);
        }
        catch (Exception)
        {
            ShowWarningMessage("MasterData.WorkCalendar.WarningMessage.StartTimeInvalid");
            return;
        }
        try
        {
            endtime = Convert.ToDateTime(para_endtime);
        }
        catch (Exception)
        {
            ShowWarningMessage("MasterData.WorkCalendar.WarningMessage.EndTimeInvalid");
            return;
        }
        if (DateTime.Compare(starttime, endtime) > 0)
        {
            ShowWarningMessage("MasterData.WorkCalendar.WarningMessage.TimeCompare");
            return;
        }

        List <WorkCalendar> workCalendars = TheWorkCalendarMgr.GetWorkCalendar(starttime, endtime, region, workcenter);

        this.GV_List.DataSource = workCalendars;
        this.GV_List.DataBind();

        GridViewHelper.GV_MergeTableCell(GV_List, new int[] { 0, 1 });
    }
Пример #2
0
    public void ListView(object sender)
    {
        string   itemCode = ((object[])sender)[0].ToString();
        string   date     = ((object[])sender)[1].ToString();
        string   viewType = ((object[])sender)[2].ToString();
        DateTime effDate  = DateTime.Now;

        item = TheItemMgr.LoadItem(itemCode);
        if (item == null)
        {
            ShowWarningMessage("MasterData.Bom.WarningMessage.CodeItem", itemCode);
            return;
        }
        try
        {
            effDate = Convert.ToDateTime(date);
        }
        catch (Exception)
        {
            ShowWarningMessage("MasterData.BomView.WarningMessage.DateInvalid");
            return;
        }

        IList <BomDetail> bomDetailList = new List <BomDetail>();

        if (viewType.ToLower() == "normal")
        {
            bomDetailList = TheBomDetailMgr.GetBomView_Nml(item, effDate);
        }
        else
        {
            bomDetailList = TheBomDetailMgr.GetBomView_Cost(itemCode, effDate);
        }
        this.GV_List.DataSource = this.ConvertListToDatatable(bomDetailList);
        this.GV_List.DataBind();

        if (GV_List.Rows.Count > 0)
        {
            IDictionary <int, int[]> dicIndex = new Dictionary <int, int[]>();
            dicIndex.Add(0, new int[] { 0, 1 });
            GridViewHelper.GV_MergeTableCell(GV_List, dicIndex);
        }
    }
Пример #3
0
 protected void GV_List_DataBound(object sender, EventArgs e)
 {
     GridViewHelper.GV_MergeTableCell(this.GV_List, new int[] { 0, 1, 2, 3 }, true);
 }