Esempio n. 1
0
        protected bool getOperDay(int id)
        {
            OperationDay op = new OperationDay();

            op.read(id);
            if (op.isParent() == true)
            {
                bUseMainBranch.Checked = false;
            }
            else
            {
                bUseMainBranch.Checked = true;
            }
            operDayStart.Text = (op.operdays == null) ? "" : op.operdays;
            operDayEnd.Text   = (op.operdaye == null) ? "" : op.operdaye;
            if (op.isTomorrow == true)
            {
                today.Checked    = false;
                tomorrow.Checked = true;
            }
            else
            {
                today.Checked    = true;
                tomorrow.Checked = false;
            }
            if (isMainFilial() == true)
            {
                operDayStart.Enabled = true;
                operDayEnd.Enabled   = true;
            }
            else
            {
                operDayStart.Enabled = bUseMainBranch.Checked;
                operDayEnd.Enabled   = bUseMainBranch.Checked;
            }
            DateTime dt1 = op.getDateTimeStart(DateTime.Now);
            DateTime dt2 = op.getDateTimeEnd(DateTime.Now);

            bUseShift.Checked = op.isShift;
            shift1s.Text      = (op.shift1s == null) ? "" : op.shift1s;
            shift1e.Text      = (op.shift1e == null) ? "" : op.shift1e;
            shift2s.Text      = (op.shift2s == null) ? "" : op.shift2s;
            shift2e.Text      = (op.shift2e == null) ? "" : op.shift2e;
            shift1s.Enabled   = op.isShift;
            shift1e.Enabled   = op.isShift;
            shift2s.Enabled   = op.isShift;
            shift2e.Enabled   = op.isShift;

            raschet = op.getMessagePart();

            return(dt1 < dt2);
        }
Esempio n. 2
0
        protected void bAcountNumberSave_Click(object sender, ImageClickEventArgs e)
        {
            lbInform.Text = "";
            int id = Convert.ToInt32(gvBranchs.DataKeys[Convert.ToInt32(gvBranchs.SelectedIndex)].Values["id"]);
            List <AccountBranch> list = getAccountBranch();

            saveAccountBranch(id, list);
            if (isMainFilial() == true || (isMainFilial() == false && bUseMainBranch.Checked == true) || (isMainFilial() == false && bUseMainBranch.Checked == false))
            {
                try
                {
                    OperationDay op = new OperationDay();
                    //if (bUseMainBranch.Checked == true) op.parent = false;
                    //else op.parent = true;
                    op.operdays = operDayStart.Text;
                    op.operdaye = operDayEnd.Text;
                    if (tomorrow.Checked == true)
                    {
                        op.isTomorrow = true;
                    }
                    else
                    {
                        op.isTomorrow = false;
                    }
                    if (isMainFilial() == false && bUseMainBranch.Checked == false)
                    {
                        op.operdays   = "";
                        op.operdaye   = "";
                        op.isTomorrow = true;
                    }
                    op.isShift = bUseShift.Checked;
                    if (bUseShift.Checked == true)
                    {
                        op.shift1s = shift1s.Text;
                        op.shift1e = shift1e.Text;
                        op.shift2s = shift2s.Text;
                        op.shift2e = shift2e.Text;
                    }
                    op.write(id);
                    getOperDay(id);
                }
                catch (Exception e1)
                {
                    ClientScript.RegisterClientScriptBlock(GetType(), "errOperDay", "<script type='text/javascript'>$(document).ready(function(){ ShowError('" + e1.Message + "');});</script>");
                }
            }
        }